'Next' works with loops like '.each' or '.times', starting the next iteration of the loop. It is useful for conditionally ending the current iteration.
File.open(file).each_line do |line|
line.gsub!(/#.*/, '') # remove comments
next if line =~ /^\s*$/ # skip blank lines
line = line.split(/\s+/)
@state = line[0] if @state.nil?
@program[line[0..1]] = line[2..4]
end
Funny, but next hadn't stuck on me before. Maybe this time.