sub test_hash { my $hashref = shift; my %hash; foreach ( values %{$hashref} ) { $hash{$_}++; return 1 if $hash{$_} > 1; } return 0; }