in reply to key-values swapped

Modulo worrying about duplicate values, just use a slice.

my %hsah; @hsah{ values %hash } = keys %hash;