Yes, my $var will go out of scope after each iteration. If you want it to stay, you must declare it outside of your for loop.
You also might find this illuminating: Lexical scoping like a fox. Someone else shared it with regard to another thread today.
In reply to Re: my within a loop
by wind
in thread my within a loop
by palkia
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |