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