Subject: | Error in documentation for uniq and distinct method calls |
Date: | Wed, 2 Apr 2014 14:32:42 +0000 |
To: | "bug-List-MoreUtils [...] rt.cpan.org" <bug-List-MoreUtils [...] rt.cpan.org> |
From: | Duarte Molha <Duarte.Molha [...] ogt.com> |
Hi
I have detected an error in the documentation of a method:
uniq LIST
distinct LIST
Returns a new list by stripping duplicate values in LIST. The order of elements in the returned list is the same as in LIST. In scalar context, returns the number of unique elements in LIST.
my @x = uniq 1, 1, 2, 2, 3, 5, 3, 4; # returns 1 2 3 5 4
my $x = uniq 1, 1, 2, 2, 3, 5, 3, 4; # returns 5
I believe the corrected version should be :
uniq LIST
distinct LIST
Returns a new list by stripping duplicate values in LIST. The order of elements in the returned list is the same as in LIST. In scalar context, returns the number of unique elements in LIST.
my @x = distinct 1, 1, 2, 2, 3, 5, 3, 4; # returns 1 2 3 5 4
my $x = uniq 1, 1, 2, 2, 3, 5, 3, 4; # returns 5
Best regards
Duarte Molha
Message body is not shown because it is too large.