The best rule of thumb is to use my unless you have some particular reason to use something else.# main scope $fred = 1; #global { # outer scope my $fred = 2; #... { #inner scope print $main::fred; # prints the global 1 } }
In reply to Re^2: difference between my and local
by Eimi Metamorphoumai
in thread difference between my and local
by jeanluca
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |