Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
My question is.. if I set $i to 0, will the next LABEL take the value of $i that i gave it, or will it go to the next $i in the loop.. so if $i equaled 9 when the loop begain, and it went through that statement, when the next LABEL; command came up, would $i equal 0 when it did the loop again, or would it equal 10?$j=23; LABEL: for ($i=$j; $i<=$#array; $i++) { if ($array[$i] eq "blah") { last LABEL; } elsif ($i == $#array) { $i = 0; next LABEL; } else { next LABEL; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Can I do this?
by chromatic (Archbishop) on Jul 14, 2001 at 07:25 UTC | |
|
Re: Can I do this?
by HyperZonk (Friar) on Jul 14, 2001 at 06:09 UTC | |
|
Re: Can I do this?
by synapse0 (Pilgrim) on Jul 14, 2001 at 06:13 UTC |