sub test_hash {     my $hr = shift;     my %h;     return 1 if ++$h{$_} > 1 for values %$hr;     return 0; }