foreach (@array) { if ($something) { # do stuff if ($something1) { # time to move to next iteration of loop before_next_stuff(); } } if ($somethingelse) { # do some other stuff before_next_stuff(); } # more stuff in loop before_next_stuff(); } sub before_next_stuff { # lots o stuff if ($x > $stop) { last; } elsif ($y ne $text) { foobar(); } else { next; } }
In reply to Re^2: next and last within subs
by xorl
in thread next and last within subs
by xorl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |