use strict; use warnings; sub foo { next LOOP; } LOOP: for ( 1 .. 10 ) { if ( $_ < 5 ) { foo(); } print "$_\n"; } ---- Exiting subroutine via next at ./test.pl line 7. Exiting subroutine via next at ./test.pl line 7. Exiting subroutine via next at ./test.pl line 7. Exiting subroutine via next at ./test.pl line 7. 5 6 7 8 9 10 #### while ( ) { next unless length; # Skip blank lines next if /^#/; # Skip comments next if /\bSKIP\b/; # Skip lines that want to be skipped # Do something useful here } #### while ( ) { if ( length ) { if ( !/^#/ ) { if ( !/\bSKIP\b/ ) { # Do something useful here } } } }