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

Replies are listed 'Best First'.
Re: Re: Hits on a reg expression
by Anonymous Monk on Sep 16, 2003 at 10:38 UTC
    Thanks it works great.