#!/usr/bin/perl -w use strict; use Data::Dumper; my @ids = (01,02,03); my @names = ('Heiz','Otto','Karl'); my %hash = map { $ids[$_], $names[$_] } 0..$#names; print Dumper \%hash;