Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

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

by ehdonhon (Curate)
on Oct 14, 2002 at 22:31 UTC ( #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? | Other CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2021-07-27 14:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?