uniqstr#

Remove subsequent duplicates by string equality, treating undef as the empty string.

Synopsis#

my @subset = uniqstr @values;
my $count  = uniqstr @values;    # scalar context - count only

What you get back#

In list context, the unique elements in first-seen order; in scalar context, their count. Unlike uniq, an undef element is indistinguishable from "" and comes back as "".

See also#

  • uniq - identical, except undef is kept as undef.

  • uniqnum / uniqint - numerical comparisons.