Beefy Boxes and Bandwidth Generously Provided by pair Networks Russ
Do you know where your variables are?
 
PerlMonks  

Re: reset of match variables

by Corion (Pope)
on Oct 03, 2011 at 14:40 UTC ( #929355=note: print w/ replies, xml ) Need Help??


in reply to reset of match variables

You can't reset them without doing a new match, but you can easily check whether there was a match:

perl -ne '/$regex/ and $SUM += $1; END { print $SUM }' file.txt


Comment on Re: reset of match variables
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (13)
As of 2014-04-17 17:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (453 votes), past polls