Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: pointer/alias question

by Anonymous Monk
on Dec 02, 2010 at 00:27 UTC ( [id://874781]=note: print w/replies, xml ) Need Help??


in reply to pointer/alias question

Consider the following:

# perl -lwE'for (reverse 0..2) { our $foo; local *foo; $foo=$_ if $_==1; print $foo // "undef"; }' undef 1 undef

# perl -lwE'for (reverse 0..2) { our $foo; # local *foo; $foo=$_ if $_==1; print $foo // "undef"; }' undef 1 1

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (6)
As of 2024-04-23 16:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found