You can try this.
STUFF: { if ($some_condition) { &some_stuff(); &condition_met() and last STUFF; &some_more_stuff; } } # last STUFF jumps here
The return statment can also be a useful shortcut in many cases when you want to do a non-local exit. (The return statement returns from the innermost sub, whether named or anonymous.)
In reply to Re: Breaking out of an 'if'
by ambrus
in thread Breaking out of an 'if'
by jpfarmer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |