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.