7stud has asked for the wisdom of the Perl Monks concerning the following question:
Dear Monks,
This is what I get when I try to use pairwise() in List::MoreUtils,
use strict; use warnings; use 5.010; use List::MoreUtils; my @arr1 = (1, 2, 3); my @arr2 = (10, 20, 30); my %hash = pairwise { ($a, $b) } @arr1, @arr2; use Data::Dumper; say Dumper(\%hash); --output:-- Name "main::b" used only once: possible typo at 1perl.pl line 10. Name "main::a" used only once: possible typo at 1perl.pl line 10. Can't call method "pairwise" on an undefined value at 1perl.pl line 10 +.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: pairwise() doesn't seem to work...
by Corion (Patriarch) on Oct 06, 2010 at 09:19 UTC | |
|
Re: pairwise() doesn't seem to work...
by eyepopslikeamosquito (Archbishop) on Oct 06, 2010 at 09:20 UTC | |
by 7stud (Deacon) on Oct 06, 2010 at 09:37 UTC | |
|
Re: pairwise() doesn't seem to work...
by AnomalousMonk (Archbishop) on Oct 06, 2010 at 10:02 UTC |