my @long = do { my %seen; grep length>4 && !$seen{$_}++, @array };