for( qw( foo bar baz ) ){ print "yep" and last if $test eq $_; } #### print "yep" and last if $test eq $_ for( qw( foo bar baz ) ); #### do { print "yep"; last; } if $test eq $_ for( qw( foo bar baz ) );