Morton Goldberg wrote:
> I like this idea, but I would suggest using a hash rather than an
> array. Hash the lines keyed to their line number. Then you can search
> any which way you like.

I don't see what this would give you. An array of the lines in the
order read would be keyed to the line number. Assuming the Ruby array
implementation is sane using an array should be faster, and also has
the advantage that IO#readlines does all the work of reading the lines
in from file and returning a ready populated array.

Vidar