for my $var (@vars) { my $endloop = 0; for my $othervar (@othervars) { if(..) { print "blubb\n"; $endloop = 1; last; } last if($endloop); } }