By design, variables declared with my are not introduced (not visible) until after the current statement. For my, this is documented in perlsub along with the rest of my's documentation.
Similar behaviour exists for local, although I can't find it documented.
In reply to Re^2: What's wrong with this local() ?
by ikegami
in thread What's wrong with this local() ?
by saintmike
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |