good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: Comparing parts of 2 strings in an array and deleting oneby Corion (Patriarch) |
on Nov 29, 2013 at 14:16 UTC ( [id://1064956]=note: print w/replies, xml ) | Need Help?? |
Whenever you think "unique", think "hash". perlfaq4 lists the common approach on how to find the unique items. My approach to your problem would be to build a hash of
... and in the end, you only need to fetch the values of that hash. If you use this approach, you lose the original order of your elements, so if that is important, you can use another approach that simply keeps track whether you've seen a particular name already:
In Section
Seekers of Perl Wisdom
|
|