http://qs1969.pair.com?node_id=291646


in reply to Hits on a reg expression

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";