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

Re^8: RFC: Tutorial: use strict; now what!?

by educated_foo (Vicar)
on Feb 09, 2012 at 17:53 UTC ( #952798=note: print w/ replies, xml ) Need Help??


in reply to Re^7: RFC: Tutorial: use strict; now what!?
in thread RFC: Tutorial: use strict; now what!?

That's your problem: my makes a variable lexical, and symbolic references only work with dynamic/global variables. BTW, this is also why mixing eval STRING with lexicals is problematic:

foobar:perl/blead% perl -le '$y="print \$x"; $z=sub { my $x=23; $y}; e +val $z->()' foobar:perl/blead% perl -le '$y="print \$x"; $z=sub { $x=23; $y}; eval + $z->()' 23


Comment on Re^8: RFC: Tutorial: use strict; now what!?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (12)
As of 2015-07-02 19:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (44 votes), past polls