- or download this
my %item_count;
%item_count{$_}++ foreach (@array);
- or download this
@result = grep {$item_count{$_} == 1} @array;
- or download this
my %item_count;
%item_count{$_}++ for grep {/pattern/} @array
@result = grep {$item_count{$_} <= 1} @array;
- or download this
@result = grep {($item_count{$_}||0) <= 1} @array;