Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Get All Duplicated Elements in an Array (Once, without shifting)

by ehdonhon (Curate)
on Oct 14, 2002 at 22:31 UTC ( [id://205240]=note: print w/replies, xml ) Need Help??


in reply to Get All Duplicated Elements in an Array (Once, without shifting)

my @in = qw/ test foo test bar baz foo test /; my %multiples; for (@in) { $multiples{$_}++; } for keys( %multiples ) { print "$_\n" if (--$multiples{$_}); }
  • Comment on Re: Get All Duplicated Elements in an Array (Once, without shifting)
  • Download Code

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-19 12:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found