From: Morton Goldberg Date: 2006-10-12T05:07:36+09:00 Subject: Re: scanning strings, backward? On Oct 11, 2006, at 10:25 AM, Vidar Hokstad wrote: > 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. It's a worthless idea. Somedays my brain behaves like a fried egg even through I don't do drugs. Today seems to be one of those days . Regards, Morton