in reply to Counting lines as I write them...
You can keep seperate counts in a hash,
Wherever you find a match, increment the corresponding key,my %count; @count(qw/@@@ *** !!!/) = (0) x 3;
and so on. To print out the results,if ( "!!!" eq substr $line => 0, 3 ) { $count{'!!!'}++; print OUTFILE $line; }
printf "Total errors for %s: %d\n", $_, $count{$_} for keys %count;
After Compline,
Zaxo
|
|---|