Help for this page

Select Code to Download


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