#!/usr/bin/perl -w use strict; my @array1 = qw(a b c); my @array2 = qw(1 2 3); my %hash; for(0..$#array1){ $hash{$array1[$_]}=$array2[$_]; }