Help for this page

Select Code to Download


  1. or download this
    # One argument is true
    
    sub any { $_ && return 1 for @_; 0 }
    
  2. or download this
    sub any(&@) {
        my $code = shift;
        $code->() && return 1 for @_;
        0
    }
    
  3. or download this
    my $has_undefs = first { not defined } @list;
    
  4. or download this
    sub count(&@) {
      my $code = shift;
      scalar grep { $code->() } @_
    }