Help for this page

Select Code to Download


  1. or download this
    sub map_pairs(&@) {
      my $f = shift;
      my @res;
    ...
      push @res, $f->($a,$b) while ($a, $b) = splice @_, 0, 2;
      return @res;
    }
    
  2. or download this
    map_pairs { $a } qw/a b c d/; # ac
    map_pairs { $b } qw/a b c d/; # bd
    map_pairs { uc($a),lc($b) } qw/a b c d/; # AbCd