Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Hits on a reg expression

by Mr. Muskrat (Canon)
on Sep 15, 2003 at 20:30 UTC ( #291646=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://291646]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2022-12-02 22:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?