my @in = qw/ test foo test bar baz foo test /; my %multiples; for (@in) { $multiples{$_}++; } for keys( %multiples ) { print "$_\n" if (--$multiples{$_}); }
In reply to Re: Get All Duplicated Elements in an Array (Once, without shifting)
by ehdonhon
in thread Get All Duplicated Elements in an Array (Once, without shifting)
by George_Sherston
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |