LOOP_ONE: while (<>) { next unless $condition_one; last LOOP_ONE; } LOOP_TWO: while (<>) { next unless $condition_two; last LOOP_TWO; } #### while (<>) { print "$ARGV: $.: $_"; } continue { if ( eof ) { close ARGV; last; } } print "\nnext While\n\n"; while (<>) { print "$ARGV: $.: $_"; } continue { if ( eof ) { close ARGV; last; } } print "\nDone\n"; #### X:\>while_eof file1 file2 file1: 1: file1 file1: 2: line2 file1: 3: line3 next While file2: 1: file2 file2: 2: line2 file2: 3: line3 Done