uniqint#

Remove subsequent duplicates by integer equality, preserving order.

Σύνοψη#

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

Τι επιστρέφεται#

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.

Παραδείγματα#

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

Διαφορές από το upstream#

Fully compatible with upstream.

Δείτε επίσης#

  • uniqnum - full numerical (float) equality.

  • uniq - string-equality deduplication.