in reply to Re: Monk Specs.?
in thread Monk Specs.?

Only problem is that you are no longer incrementing counter after you encounter the date.

my $counter = 0; my $dateRX = qr/^$date/; # assuming $date is defined elsewhere while (<LOG>){ last if /$dateRX/; $counter++; } while ( <LOG> ) { print LOGFILE; $counter++; }

UPDATE: I assumed that $counter was actually doing something outside of the context of this code, maybe I should not have assumed that. If the only thing that counter is being used for is to assign the start date variable, then my revision above is un-neccessary. It should also be noted that in the original code, since counter is incremented before the regexp is checked, then the start date variable will always point to the first line AFTER the one that matched.