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