Is this ok? But it still use variable :(

file.each_line { |line|
  if line =~ (a ||= $line_patterns["pattern a"])
    process_pattern_a(line)
  elsif line =~ (b ||= $line_patterns["pattern b"])
    process_pattern_b(line)
  # some more elsifs
  end
}
-- 
Posted via http://www.ruby-forum.com/.