Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

RE: RE: Re: Scope of regular expression variables

by chromatic (Archbishop)
on Sep 16, 2000 at 02:15 UTC ( [id://32753]=note: print w/replies, xml ) Need Help??


in reply to RE: Re: Scope of regular expression variables
in thread Scope of regular expression variables

I'm not sure whether I disagree or not. To wit:
$_ = "abcde"; if (/(.)(.)/) { # first two if (/(.)(.)$/) { print "inner: $1 $2\n"; } print "outer: $1 $2\n"; } print "outer: $1 $2\n";
$1 and $2 aren't localized within the if block -- unless the regex is also within the same enclosing block.

(At least, that makes it more explicit.)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-20 02:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found