Cari di Perl 
    Perl User Manual
Daftar Isi
(Sebelumnya) Get the prototype (if any) of ...Get out of a function early (Berikutnya)
Keywords related to control flow of your perl program

Start this loop iteration over again

Daftar Isi

  • redo LABEL

  • redo

    The redo command restarts the loop block without evaluating theconditional again. The continue block, if any, is not executed. Ifthe LABEL is omitted, the command refers to the innermost enclosingloop. Programs that want to lie to themselves about what was just input normally use this command:

    1. # a simpleminded Pascal comment stripper
    2. # (warning: assumes no { or } in strings)
    3. LINE: while (<STDIN>) {
    4. while (s|({.*}.*){.*}|$1 |) {}
    5. s|{.*}| |;
    6. if (s|{.*| |) {
    7. $front = $_;
    8. while (<STDIN>) {
    9. if (/}/) { # end of comment?
    10. s|^|$front\{|;
    11. redo LINE;
    12. }
    13. }
    14. }
    15. print;
    16. }

    redo cannot be used to retry a block that returns a value such aseval {}, sub {}, or do {}, and should not be used to exita grep() or map() operation.

    Note that a block by itself is semantically identical to a loopthat executes once. Thus redo inside such a block will effectivelyturn it into a looping construct.

    See also continue for an illustration of how last, next, andredo work.

 
Source : perldoc.perl.org - Official documentation for the Perl programming language
Site maintained by Jon Allen (JJ)     See the project page for more details
Documentation maintained by the Perl 5 Porters
(Sebelumnya) Get the prototype (if any) of ...Get out of a function early (Berikutnya)