TRY: { foreach my $try ( @options ) { next unless exists $hash{ $try }; do_something( $try ); last TRY; } log_failure(); }