in reply to scanning hash
Here's a scalable, undef-friendly solution, just for kicks:
It does distinguish between strings and numbers that eq would say were the same, though.my $multiple_values; my ($k,$v); use Data::Dumper; $Data::Dumper::Useqq = 1; while (defined($k = each %hash)) { if ($v) { ++$multiple_values, last if Dumper($hash{$k}) ne $v; } else { $v = Dumper($hash{$k}) } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: scanning hash
by Aristotle (Chancellor) on Aug 01, 2004 at 15:05 UTC |
In Section
Seekers of Perl Wisdom