Thanks a lot anurag! Your answer is exactly what I wanted =)

> A better alternative since the block invocation automatically takes
> care of closing the file:
>
> lines = File.open(filename) {|f| f.readlines}
>
> or just,
>
> lines = File.readlines(filename)

Does File.open opens in "r" or "w"?

-- 
Posted via http://www.ruby-forum.com/.