Perl Monk, Perl Meditation | |
PerlMonks |
Re: Difference b/w my and local var?by boom (Scribe) |
on Mar 11, 2009 at 13:40 UTC ( [id://749876]=note: print w/replies, xml ) | Need Help?? |
The variables declared with my() are visible only within the scope of the block which names them. They are not visible outside of this block, not even in routines or blocks that it calls. local() variables, on the other hand, are visible to routines that are called from the block where they are declared. Neither is visible after the end of the block at all.
In Section
Seekers of Perl Wisdom
|
|