Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
go ahead... be a heretic
 
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 rifling through the Monastery: (10)
As of 2014-04-23 18:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (552 votes), past polls