in reply to Re: improve ugly flow control
in thread improve ugly flow control

This would have been obvious 30 years ago; perhaps less so today:
foreach my $try (@options) { next unless exists $hash{$try}; do_something($try); goto SUCCESS; } log_failure(); SUCCESS: ...