http://www.perlmonks.org?node_id=392137


in reply to improve ugly flow control

Just a different try on this:
use List::Util qw(first); if (defined(my $try = first { $hash{$_} } @options)) { do_something($try); } else { log_failure(); }

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.