Do this:my $num = 0; for (1..5) { $num++; . . }
This keeps the $num variable nicely local to the loop.for my $num (1..5) { # You can use $num in the loop, and it gets # increased automatically }
Arjen
In reply to Re: How do I reference a variable?
by Aragorn
in thread How do I reference a variable?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |