Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

RE: RE: Re: Scope of regular expression variables

by takshaka (Friar)
on Aug 30, 2000 at 02:35 UTC ( [id://30231]=note: print w/replies, xml ) Need Help??


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

It works that way for manual localization in the conditional as well. That's fairly counterintuitive considering that my() does the opposite.
($one, $two) = (1,2); { if (local ($one, $two) = qw(abc def)) { print "local inner : $one $two\n"; } print "local outer : $one $two\n"; } print "local outside: $one $two\n"; my ($a, $b) = (1,2); { if (my ($a, $b) = qw(abc def)) { print "my inner : $a $b\n"; } print "my outer : $a $b\n"; } print "my outside: $a $b\n"; __END__ local inner : abc def local outer : abc def local outside: 1 2 my inner : abc def my outer : 1 2 my outside: 1 2

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-04-18 03:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found