in reply to Comparing file contents to array values
-derby
update: Okay how about
where key is the number your looking for. Sure you could do more fancy things like munge the array into a hash or DBFile but grep should suffice. All the matching records will be in results, then just roll through those to output the data you want:@results = grep( /^$key/, @raw_data );
foreach( @results ) { $record = $_; # strip the beginning key $record =~ s/^\d+//; print $record; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: simple for some
by nasa (Beadle) on Nov 23, 2002 at 03:35 UTC |