my @array = qw( foo bar bar baz ); my %h; $h{$_}++ for @array; my @dup = grep $h{$_} > 1, keys %h; print join( ", ", @dup );
"There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.
In reply to Re: Extract Duplicates by one liner
by hardburn
in thread Extract Duplicates by one liner
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |