'last' and 'next' always break the innermost loop, so it's perfectly clear.
But it's a lot clearer to read if you use labels ( traditionally ALLCAPS ).
LINE: while ( my $line = <$datafile> ) { my @fields = split ',', $line; FIELD: for my $field ( @fields ) { if ( foo() ) { next FIELD; } elsif ( bar() ) { next LINE; } else { more(); } } }
As Occam said: Entia non sunt multiplicanda praeter necessitatem.
In reply to Re: Keyword last for loops
by TomDLux
in thread Keyword last for loops
by Thakur
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |