Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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 contemplating the Monastery: (6)
As of 2015-07-30 05:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (270 votes), past polls