Yes, to be more accurate: my creates a variable that exists till the end of the innermost enclosing block.And to be even more accurate, it creates a variable that has a name that exists until the end of the block (or until the name is shadowed by a duplicated identical name). The variable itself might persist beyond the end of the block (as an anonymous variable), if there are still other references to the variable.
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
In reply to Re^2: difference between my and local
by merlyn
in thread difference between my and local
by jeanluca
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |