in reply to Re: Unique list of hashes
in thread Unique list of hashes
Make a key out of combined values to search for uniqueness ... @uniq = grep !$seen{ join '' , sort values %{ $_ } }++, @list;
So these are all the same?
my @list = ( { foo=>'bar', quz=>'baz' }, { abc=>'bar', def=>'baz' }, { ijk=>'ba', xyz=>'rbaz' }, { r=>'ba', s=>'rba', t=>'z' }, { x=>'barbaz' }, );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Unique list of hashes
by hdb (Monsignor) on Mar 02, 2015 at 12:05 UTC | |
|
Re^3: Unique list of hashes
by parv (Parson) on Mar 02, 2015 at 12:24 UTC |