Replace your for section with this and give it whirl.
my $total; for(@files) { my $hits = () = $_ =~ /abcdef/g; print $hits,"\n"; $total += $hits; } print "total: $total\n";
In reply to Re: Hits on a reg expression
by Mr. Muskrat
in thread Hits on a reg expression
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |