Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: reset of match variables

by hbm (Hermit)
on Oct 03, 2011 at 18:22 UTC ( #929399=note: print w/ replies, xml ) Need Help??


in reply to Re: reset of match variables
in thread reset of match variables

Or even just this:

$SUM += /$regex/;

Update: Sorry, mine only counts the number of matches (like grep -c). To accumulate the values of matches, I still instinctively reach for (something like) this:

nawk '/([0-9]*)/{tot+=$1}END{print tot}' file


Comment on Re^2: reset of match variables
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (15)
As of 2014-11-26 15:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (171 votes), past polls