my @new_array; while (my ($key, $value) = each %hash) { for (@array) {push @new_array, $key if ($value eq $_);} } __END__ $VAR1 = [ '2', '1' ];