in reply to improve ugly flow control
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.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: improve ugly flow control
by perrin (Chancellor) on Sep 19, 2004 at 20:52 UTC | |
by merlyn (Sage) on Sep 20, 2004 at 05:55 UTC | |
Re^2: improve ugly flow control
by Aristotle (Chancellor) on Sep 20, 2004 at 09:50 UTC |