perlfunc
gods
<P>
redo - start this loop iteration over again
<P>
<HR>
<P>
redo
<FONT SIZE=-1>LABEL</FONT>
<P>
redo
<P>
<HR>
<P>
The [perlfunc:redo|redo] command restarts the loop block without evaluating the conditional again.
The [perlfunc:continue|continue] block, if any, is not executed. If the
<FONT SIZE=-1>LABEL</FONT> is omitted, the command refers to the innermost
enclosing loop. This command is normally used by programs that want to lie
to themselves about what was just input:
<P>
<PRE> # a simpleminded Pascal comment stripper
# (warning: assumes no { or } in strings)
LINE: while (<STDIN>) {
while (s|({.*}.*){.*}|$1 |) {}
s|{.*}| |;
if (s|{.*| |) {
$front = $_;
while (<STDIN>) {
if (/}/) { # end of comment?
s|^|$front\{|;
redo LINE;
}
}
}
print;
}
</PRE>
<P>
See also [perlfunc:continue|continue] for an illustration of how [perlfunc:last|last], [perlfunc:next|next], and
[perlfunc:redo|redo] work.
<HR>