"Brian F. Feldman" <green / FreeBSD.org> writes:

> Alternatively, to have it read the whole file into memory before processing 
> it:
> 
> lines = File.open("foo.txt", "r") {|file| file.readlines.grep(/FOO/)}

A neat shortcut is

  lines = File.open("foo.txt").grep /FOO/

because File objects are Enumerable


Regards


Dave