MBolton has asked for the wisdom of the Perl Monks concerning the following question:
One other note, the reason that I am trying to match on that particular reg ex is because the first line of each log entry (which also includes the date in mm/dd/yyyy format) begins with a six digit sequence number (with leading zeroes). Thanks very much in advance for any guidance!LINE: while ($currentfile=<FILE>) { if ($currentfile =~ /^[0-9][0-9][0-9][0-9][0-9][0-9]/){ $match_date = substr($currentfile,52,10); if ($search_date eq $match_date) { print RESULTS "$currentfile"; do { next LINE; print RESULTS "$currentfile"; } until eof(); } #if search_date } # if $currentfile } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Looping through end of file once a match is found
by Animator (Hermit) on Jun 21, 2005 at 16:37 UTC | |
|
Re: Looping through end of file once a match is found
by davidrw (Prior) on Jun 21, 2005 at 16:20 UTC | |
|
Re: Looping through end of file once a match is found
by Transient (Hermit) on Jun 21, 2005 at 16:16 UTC | |
by thundergnat (Deacon) on Jun 21, 2005 at 16:18 UTC | |
|
Re: Looping through end of file once a match is found
by mkmcconn (Chaplain) on Jun 21, 2005 at 19:47 UTC | |
|
Re: Looping through end of file once a match is found
by GrandFather (Saint) on Jun 21, 2005 at 21:14 UTC |