The redo command restarts the loop block without evaluating the conditional again.
my $redid = 0; my @list = (1..5); xyz : for (@list) { print; redo if $_ == 3 && ! $redid++; } # Output: 123345
In reply to Re^4: removing the goto
by imp
in thread removing the goto
by scoobyrico
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |