This code prints 4.our $bar; sub foo { local $bar = 4; # different $bar zbr(); } sub zbr { print $bar; }
The correct way is to pass parameters to functions.
Alberto Simões
In reply to Re: nested Subroutines and my var
by ambs
in thread nested Subroutines and my var
by KaiAllard
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |