- or download this
use strict;
use warnings;
use List::MoreUtils qw/uniq/;
...
my @drop_duplicates = uniq grep {length > 4} @array;
{ local $, = "\n"; print @drop_duplicates;}
- or download this
use strict;
use warnings;
...
my @only_once = grep {$seen{$_} == 1 } map {$seen{$_}++; $_} grep {len
+gth > 4} @array;
{ local $, = "\n"; print @only_once;}