Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Remove duplicate strings from an array

by ferreira (Chaplain)
on Mar 13, 2007 at 14:48 UTC ( #604555=note: print w/replies, xml ) Need Help??


in reply to Remove duplicate strings from an array

This is almost a FAQ.

sub uniq { my %h; return grep { !$h{$_}++ } @_ }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://604555]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (6)
As of 2019-10-15 06:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?