in reply to Throw compilation error(or warning) if duplicate keys are present in hash
outputuse strict; use warnings; my %hash = ("one" => "1", "two" => "2", "one" => "3", ); foreach my $key ( keys %hash ) { print $key, " => ", $hash{$key}, "\n"; }
unable to track the dublicate key.filtration done by perl itselfone => 3 two => 2
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Throw compilation error(or warning) if duplicate keys are present in hash
by ikegami (Patriarch) on Nov 25, 2011 at 04:02 UTC |