$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.
In reply to Re: my and local variable significance in a particular case
by tobyink
in thread my and local variable significance in a particular case
by ghosh123
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |