in reply to Removing Duplicates in a HoH
It's not clear what you are intending the code to actually do, but perhaps the issue isn't how to remove "duplicate" keys. Perhaps what you really ought to consider is if there is a better way to store the data in the first place such that you don't need to remove the duplicate keys? I notice that THERMOMETER has two different values for quantity, is arbitrarily removing one of the thermometer entries what you really want? I don't know, since I don't know if the quantity data is important.
Anyway, my main point is that it might be better to store your data by part number.
$HoH{$part_number}{quantity}= $qty; $HoH{$part_number}{description} = $description; ...
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Removing Duplicates in a HoH
by DunLidjun (Acolyte) on Dec 20, 2010 at 15:10 UTC | |
by state-o-dis-array (Hermit) on Dec 20, 2010 at 15:19 UTC | |
by DunLidjun (Acolyte) on Dec 20, 2010 at 15:42 UTC |
In Section
Seekers of Perl Wisdom