#! /usr/bin/perl @a = qw(a b c d ); $b{x} = 10 ; %b = map { $_, 1} splice(@a, 0, scalar(@a) ); print "$_ --> $b{$_}\n" foreach (keys %b) ;