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.
In reply to •Re: improve ugly flow control
by merlyn
in thread improve ugly flow control
by perrin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |