Help for this page

Select Code to Download


  1. or download this
    sub multi_and {
       my $result = shift;
       while (@_) { $result &= shift; }
       $result;
    }
    
  2. or download this
    my $results1 = multi_and(1,2,3);             # 3 args
    my $results2 = multi_and(5,6,7);             # 3 args
    my $results3 = multi_and(12,13,14,15,16);    # 5 args
    
  3. or download this
    sub multi_and {
      my $result = shift;
      for (@_) { $result &= $_ }
      $result
    }