So when the next line assigns to 'my_var' - the assignment is done to a global variable.
That's not what's happening. It is indeed assigning to the lexical var.
Running my pushes a directive on the stack that clears the lexical var on scope exit. This is what's being skipped in the OP's code.
In reply to Re^2: Conditional initialization of lexical (my) variables
by ikegami
in thread Conditional initialization of lexical (my) variables
by muthm
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |