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