You're working too hard and breaking stuff. Don't redeclare $thingy, just use it once. When you redeclare you've just gotten yourself a whole different thingy and not the thingy you meant to get. Same data tho. Just a different thingy.
{ use warnings; my $thingy = 'thangy'; sub doit { $thingy; # Close over $thingy eval 'print "thingy is $thingy\n"'; } }
⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊
In reply to Re^3: "eval" and "my" variable weirdness
by diotalevi
in thread "eval" and "my" variable weirdness
by splinky
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |