my %hash; for my $i (0..$#people) { $hash{$people[$i]} = $jobs[$i]; } #### my %hash; foreach my people (@people) { $hash{$people}= shift @jobs; }