Help for this page

Select Code to Download


  1. 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;}
    
  2. 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;}