nasa has asked for the wisdom of the Perl Monks concerning the following question:
Then I have split the line thus.$data_file="learn.data"; open(DAT, $data_file) || die("Could not open file!"); @raw_data=<DAT>; @results = grep( /^$line[0]/, @raw_data ); foreach( @results ) { $record = $_; }
Puzzle is. How can I ask, What is the preceding line in the database.? Give me the line that was printed just before the one we just extracted.? May god bless your living sole . Nasa.open(I, $data_path); $found=0; while(<I>){ chomp; @line = split(/\t/, $_); if($line[0] eq $GET{'id'}){ $found=1; last; } } close(I);
update (broquaint): title change (was What wize monk can help?)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: What wize monk can help?
by DamnDirtyApe (Curate) on Nov 27, 2002 at 22:00 UTC | |
|
Re: What wize monk can help?
by John M. Dlugosz (Monsignor) on Nov 28, 2002 at 00:45 UTC |