for ( @whatever ) { if ( 1 .. 4 ) { # enter this block during the first four iterations, then never again } } #### $_ = 0; while ($_<6) { $_++; if ( 1 .. 4 ) { print "$_: True\n"; next; } print "$_: False\n"; } __OUTPUT__ 1: False 2: False 3: False 4: False 5: False 6: False #### $_ = 0 while ($_<6) { $_++; if ( 0 .. 3 ) { print "$_: True\n"; next; } else { print "$_: False\n"; } } __OUTPUT__ 1: True 2: True 3: True 4: True 5: True 6: True