while() { next if 1../The mail system/; # The condition will be true from line 1 until "The mail system" # Code here } #### use v5.14; use Data::Dumper; my @list = 1..3; for (@list) { print while (); } say Dumper \@list; __DATA__ #### $VAR1 = [ undef, undef, undef ];