more useful options | |
PerlMonks |
Re: Removing duplicates from an arrayby cdarke (Prior) |
on Jan 02, 2008 at 17:00 UTC ( [id://660011]=note: print w/replies, xml ) | Need Help?? |
To try to answer your update. The subroutine builds a hash using the elements of the input array as keys (the values are just set to 1, and not used). Since hash keys are unique, any duplicates will just overwrite the previous value. It then dumps the keys (using keys), and implicitly returns the resulting array. Use it thus:
In Section
Seekers of Perl Wisdom
|
|