my %reverse = reverse %hash; die "Useful message" unless scalar keys %reverse == scalar keys %hash;