Update: Actually, no. You need to remove the three lines mentioning $last:
my @history; my $expect = 1; while (<>) { chomp; my ($num) = /EVENT(\d+)/ or next; # Ignore bad input. if ($num == 1 || $num != $expect) { @history = (); $expect = 1; } if ($num == $expect) { push @history, "$_\n"; if ($expect++ == 4) { print(@history); @history = (); $expect = 1; } } }
The funny thing is that I didn't have those three lines originally since I had forgotten that part of your question when I first wrote up my reply.
In reply to Re: Log Parsing Help
by ikegami
in thread Log Parsing Help
by dlcasey
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |