good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Unique list of hashesby mrguy123 (Hermit) |
on Mar 02, 2015 at 11:12 UTC ( [id://1118393]=perlquestion: print w/replies, xml ) | Need Help?? |
mrguy123 has asked for the wisdom of the Perl Monks concerning the following question:
Hi monks Haven't asked a question in a while but this is an interesting case (also I really need to solve it). Say I have a list of hashes, for example: I want to make this list unique, meaning it needs to look like this: List::MoreUtils::uniq doesn't work on lists of hashes so that's a no go. I can do it for one hash key (below) but for 2 or more keys it's tricky Of course I can find a workaround (e.g. make each hash into a string and then sort ...) but I would like to try and find something better (and shorter) if possible Any ideas? Everybody seems to think I'm lazy I don't mind, I think they're crazy
Back to
Seekers of Perl Wisdom
|
|