sub first (&@) { my $cref = shift; $cref->($_) and return $_ for @_; } #### # get the first number found over 1000 $first_match = first { $_ > 1000 } @numbers; #### my %seen; @seen{@array} = (); #### if (exists $seen{blah}) { ... }
## # get the first number found over 1000 $first_match = first { $_ > 1000 } @numbers; ##
## my %seen; @seen{@array} = (); ##
## if (exists $seen{blah}) { ... }