Hi,

From: <christopher.j.meisenzahl / citicorp.com>
> 
> What's the best Ruby idiom for reading data from a data file one line at a time 
> so that I could run the program with something like:
> my_app.rb < data.txt

A way to read lines from STDIN is:

while(line = gets)
  # do something with line
end


Or, to read lines from a particular file by name:

IO.foreach("data.txt") do |line|
  # do something with line
end


Hope this helps,

Bill