in reply to Looping through end of file once a match is found
my $found_date = 0; LINE: while ($currentfile=<FILE>) { if (!$found_date and $currentfile =~ /^\d{6}/){ $match_date = substr($currentfile,52,10); if ($search_date eq $match_date) { $found_date = 1; } } next unless $found_date; print RESULTS "$currentfile"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Looping through end of file once a match is found
by thundergnat (Deacon) on Jun 21, 2005 at 16:18 UTC |