Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: pairwise() doesn't seem to work...

by AnomalousMonk (Abbot)
on Oct 06, 2010 at 10:02 UTC ( #863745=note: print w/ replies, xml ) Need Help??


in reply to pairwise() doesn't seem to work...

And get rid of the  Name "main::whatever" used only once ... warnings with a  use vars qw($a $b); (or similar) statement.

>perl -wMstrict -le "use 5.010; use List::MoreUtils qw(pairwise); my @arr1 = (1, 2, 3); my @arr2 = (10, 20, 30); use vars qw($a $b); my %hash = pairwise { ($a, $b) } @arr1, @arr2; use Data::Dumper; say Dumper(\%hash); " $VAR1 = { '1' => 10, '3' => 30, '2' => 20 };


Comment on Re: pairwise() doesn't seem to work...
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (2)
As of 2014-09-21 00:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (165 votes), past polls