uniqint#

Remove subsequent duplicates by integer equality, preserving order.

Synopsis#

my @subset = uniqint @values;
my $count  = uniqint @values;    # scalar context — count only

What you get back#

In list context, the unique integer values in first-seen order — every input is truncated to its integer part before comparison, and the returned list itself contains integers (not the original SVs). undef is treated as 0.

Examples#

my @u = uniqint 1.1, 1.9, 2.0;     # (1, 2)
my @u = uniqint '3', 3, 3.7;       # (3)
my $n = uniqint 1, 2, 2, 3;        # 3

Differences from upstream#

Fully compatible with upstream.

See also#

  • uniqnum — full numerical (float) equality.

  • uniq — string-equality deduplication.