use strict; use warnings; use Hash::MultiValue; use 5.012; my $mhash = Hash::MultiValue->new( "one" => "3", "two" => "2", "two" => "1" ); die "Duplicate key detected for \%hash" if grep { my @a = $mhash->get_all($_); @a > 1 } $mhash->keys; print "We're good!";