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

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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://952798]
[Discipulus]: good morning monks! or whatever daypart you are experiencing..
choroba . o O ( workpart )

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2017-02-21 08:15 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (308 votes). Check out past polls.