Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: How do I remove the duplicates from the array?

by pvaldes (Chaplain)
on Sep 26, 2013 at 20:40 UTC ( #1055896=note: print w/replies, xml ) Need Help??


in reply to How do I remove the duplicates from the array?

use List::MoreUtils qw{uniq}; my @array = uniq (-20, 20, 1, 1, 2, 2, 2, 9, 3, -4, -4, 5, -20, 20, 7 +, 7, 7); foreach (@array){print "$_, "};

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1055896]
help
Chatterbox?
vrk takes a cookie from the platter on the sideboard.
Eily thinks vrk is a cookie monster
talexb thinks the term 'cookie monster' is unnecessarily drogatory ;) and takes a cookie as well. Mmmm. Delicious cookies.
[davido]: A tool as pretentious as Test::Perl::Critic ought not fail to install because one of its dependencies failed to pull in List::MoreUtils.

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (11)
As of 2017-04-25 15:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (458 votes). Check out past polls.