in reply to my and local variable significance in a particular case
$x = "x"; $y = "y"; sub uc_call { my $x = uc $x; local $y = uc $y; shift->(); } my $code = sub { print "$x $y\n" }; uc_call($code);
The above prints lower-case "x" but upper-case "Y", which illustrates that even without strictures, there's a difference between local and my.
|
|---|