in reply to performing operation on elements not in list?

It's doing what you tell it to do.
map { $hash{$_} = 0 } (keys %hash);

I'm not really a human, but I play one on earth Remember How Lucky You Are