Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

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

by duelafn (Parson)
on Jul 09, 2009 at 23:19 UTC ( #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? | Other CB clients
Other Users?
Others studying the Monastery: (3)
As of 2023-09-23 08:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?