LINE: { # ... redo LINE if # ... # ... } #### my $done = 0; # ... sub { my( @data, $row, $key ); my $found= 0; while( ! $found && ! $done && defined( $row= <$fh> ) ) { chomp($row); ( $found, $done )= predicate( $row, \$key, \@data ); } return( $key, \@data ) if $allow; return; #### while( conditional ) { code } #### for( init; condition; cont; ) { code; } #### init; while( contition ) { code; } continue { cont; } #### my $done= 0; # ... my( @data, $row, $key ); return if $done || ! defined( $row= <$fh> ); do { chomp( $row ); # [SNIPPED] munge $row, set $key and @data } while( $key < $min && defined( $row= <$fh> ) ); if( $max < $key ) { $done = 1; return; } return( $key, \@data ); }