On Apr 15, 2007, at 3:25 PM, Brian Candler wrote:

> Or, less perly,
>
> while line = gets
>   # do stuff with line
> end

I really feel the Ruby version is to use a standard iterator:

ARGF.each do |line|
   # do stuff with line
end

> Or, if there are multiple files listed on ARGV, and you want to  
> slurp them
> all one at a time,
>
> while contents = gets(nil)
>   # do stuff with contents
> end

contents = ARGF.read

James Edward Gray II