my @a = ('one', 'two', 'three'); my @b = (1, 2, 3); my %result; for (my $i = 0; $i < scalar(@a); $i++) { $result{$a[$i]} = $b[$i]; }