in reply to Re: Re: Test break, but still doing
in thread Test break, but still doing

Did you try it? next doesn't apply to if-blocks, it applies to the enclosing loop-block (for or while, or a naked block which is a loop executed once) ... if-blocks are not loops. Similarly for redo and last.

  • Comment on Re: Re: Re: Test break, but still doing

Replies are listed 'Best First'.
Re: Re: Re: Re: Test break, but still doing
by Tyke (Pilgrim) on Feb 21, 2001 at 13:26 UTC
    And if you do have nested loops, you can always break out of the one that you want by using labels...
    LAB_1:
      while ([cond1]) {
    
    LAB_2:
        while ([cond2]) {
          next LAB_1 if [cond3];
        }
      }
    
    As archon says, its all there in the perlsyn page.