Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Mini-Tutorial: Working with Odd/Even Elements

by duelafn (Parson)
on Jul 09, 2009 at 23:19 UTC ( [id://778724]=note: print w/replies, xml ) Need Help??

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
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://778724]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (9)
As of 2024-03-28 18:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found