in reply to Hash Multiple values for a key-Filtering unique values for a key in hash
One more thing here, Let's say I get key/values as below in my hash
Where a certain value appears twice for different keys, for e.g. 'Eufaula' is a value for key 'Alabama' & 'California'
Likewise, 'Beacon' appears for both 'New York' & 'Utah'
Can i delete this for one key only (no particular where i need to retain this value for which key, just need once in any key)
my $HASH1 = { 'Alabama' => ['Andalusia', 'Anniston', 'Clanton', 'Eufaula', 'Aubur +n'], 'California' => ['Barstow','Eufaula'], 'New York' => ['Amsterdam','Coney Island','Beacon'], 'Utah' => ['Beacon','Layton'] };
so my result hash should look like
Thanks.my $HASH1 = { 'Alabama' => ['Andalusia', 'Anniston', 'Clanton', 'Eufaula', 'Aubur +n'], 'California' => ['Barstow'], 'New York' => ['Amsterdam','Coney Island','Beacon'], 'Utah' => ['Layton'] };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Hash Multiple values for a key-Filtering unique values for a key in hash
by tobyink (Canon) on May 23, 2017 at 10:36 UTC | |
|
Re^2: Hash Multiple values for a key-Filtering unique values for a key in hash
by hippo (Archbishop) on May 23, 2017 at 08:55 UTC | |
|
Re^2: Hash Multiple values for a key-Filtering unique values for a key in hash
by kcott (Archbishop) on May 24, 2017 at 05:44 UTC |