Skip Menu |

This queue is for tickets about the List-MoreUtils CPAN distribution.

Report information
The Basics
Id: 102885
Status: resolved
Priority: 0/
Queue: List-MoreUtils

People
Owner: Nobody in particular
Requestors: louying [...] pwrd.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.412



Subject: uniq function bug
Date: Thu, 19 Mar 2015 18:40:29 +0800
To: <bug-List-MoreUtils [...] rt.cpan.org>
From: 楼颖 <louying [...] pwrd.com>
Dear, follow array use function uniq lead to incorrect result. [0] "1603601,20150319", [1] "1600581,20150319", [2] "0300247,20150319", [3] "0300092,20150319", [4] "0002694,20150319", [5] "0002663,20150319", [6] "0002325,20150319", [7] "0002093,20150319"
On Thu Mar 19 06:40:47 2015, louying@pwrd.com wrote: Show quoted text
> Dear, follow array use function uniq lead to incorrect result. > > > [0] "1603601,20150319", > [1] "1600581,20150319", > [2] "0300247,20150319", > [3] "0300092,20150319", > [4] "0002694,20150319", > [5] "0002663,20150319", > [6] "0002325,20150319", > [7] "0002093,20150319"
Can you please attach a small script or code piece showing your use-case and the expected result compared to wrong given? Thanks in advance
perl -MData::Dumper -MList::MoreUtils=uniq -e 'my @a = qw(1603601,20150319 1600581,20150319 0300247,20150319 0300092,20150319 0002694,20150319 0002663,20150319 0002325,20150319 0002093,20150319); print Dumper \@a; print Dumper [uniq @a]' $VAR1 = [ '1603601,20150319', '1600581,20150319', '0300247,20150319', '0300092,20150319', '0002694,20150319', '0002663,20150319', '0002325,20150319', '0002093,20150319' ]; $VAR1 = [ '1603601,20150319', '1600581,20150319', '0300247,20150319', '0300092,20150319', '0002694,20150319', '0002663,20150319', '0002325,20150319', '0002093,20150319' ]; I don't see any problem
Subject: 答复: [rt.cpan.org #102885] uniq function bug
Date: Fri, 20 Mar 2015 09:10:28 +0800
To: <bug-List-MoreUtils [...] rt.cpan.org>
From: 楼颖 <louying [...] pwrd.com>
Follow is section of my big program: use DDP; use List::MoreUtils qw(uniq) ..... @cfg_array = grep { $_ =~ /^\d{7}.*/ } @cfg_array; p @cfg_array; @cfg_array = uniq @cfg_array; p @cfg_array; exit; ..... I gen the following output : [ [0] "1603601,20150319", [1] "1600581,20150319", [2] "0300247,20150319", [3] "0300092,20150319", [4] "0002694,20150319", [5] "0002663,20150319", [6] "0002325,20150319", [7] "0002093,20150319" ] (tied to Tie::File) [ [0] "1603601,20150319" ] (tied to Tie::File) This just happen in List::MoreUtils(0.408), 0.406 work fine. Regards -----邮件原件----- 发件人: Jens Rehsack via RT [mailto:bug-List-MoreUtils@rt.cpan.org] 发送时间: 2015年3月19日 19:38 收件人: 楼颖 主题: [rt.cpan.org #102885] uniq function bug <URL: https://rt.cpan.org/Ticket/Display.html?id=102885 > perl -MData::Dumper -MList::MoreUtils=uniq -e 'my @a = qw(1603601,20150319 1600581,20150319 0300247,20150319 0300092,20150319 0002694,20150319 0002663,20150319 0002325,20150319 0002093,20150319); print Dumper \@a; print Dumper [uniq @a]' $VAR1 = [ '1603601,20150319', '1600581,20150319', '0300247,20150319', '0300092,20150319', '0002694,20150319', '0002663,20150319', '0002325,20150319', '0002093,20150319' ]; $VAR1 = [ '1603601,20150319', '1600581,20150319', '0300247,20150319', '0300092,20150319', '0002694,20150319', '0002663,20150319', '0002325,20150319', '0002093,20150319' ]; I don't see any problem
Subject: 答复: [rt.cpan.org #102885] uniq function bug
Date: Fri, 20 Mar 2015 09:16:27 +0800
To: <bug-List-MoreUtils [...] rt.cpan.org>
From: 楼颖 <louying [...] pwrd.com>
My develop env is : OS : win7 64bit Perl : activestate perl 5.16.3(32 bit) List::Moreutil : 0.408 build from cpan not PPM. Regards -----邮件原件----- 发件人: 楼颖 [mailto:louying@pwrd.com] 发送时间: 2015年3月20日 9:10 收件人: 'bug-List-MoreUtils@rt.cpan.org' 主题: 答复: [rt.cpan.org #102885] uniq function bug Follow is section of my big program: use DDP; use List::MoreUtils qw(uniq) ..... @cfg_array = grep { $_ =~ /^\d{7}.*/ } @cfg_array; p @cfg_array; @cfg_array = uniq @cfg_array; p @cfg_array; exit; ..... I gen the following output : [ [0] "1603601,20150319", [1] "1600581,20150319", [2] "0300247,20150319", [3] "0300092,20150319", [4] "0002694,20150319", [5] "0002663,20150319", [6] "0002325,20150319", [7] "0002093,20150319" ] (tied to Tie::File) [ [0] "1603601,20150319" ] (tied to Tie::File) This just happen in List::MoreUtils(0.408), 0.406 work fine. Regards -----邮件原件----- 发件人: Jens Rehsack via RT [mailto:bug-List-MoreUtils@rt.cpan.org] 发送时间: 2015年3月19日 19:38 收件人: 楼颖 主题: [rt.cpan.org #102885] uniq function bug <URL: https://rt.cpan.org/Ticket/Display.html?id=102885 > perl -MData::Dumper -MList::MoreUtils=uniq -e 'my @a = qw(1603601,20150319 1600581,20150319 0300247,20150319 0300092,20150319 0002694,20150319 0002663,20150319 0002325,20150319 0002093,20150319); print Dumper \@a; print Dumper [uniq @a]' $VAR1 = [ '1603601,20150319', '1600581,20150319', '0300247,20150319', '0300092,20150319', '0002694,20150319', '0002663,20150319', '0002325,20150319', '0002093,20150319' ]; $VAR1 = [ '1603601,20150319', '1600581,20150319', '0300247,20150319', '0300092,20150319', '0002694,20150319', '0002663,20150319', '0002325,20150319', '0002093,20150319' ]; I don't see any problem
Subject: 答复: [rt.cpan.org #102885] uniq function bug
Date: Fri, 20 Mar 2015 09:28:17 +0800
To: <bug-List-MoreUtils [...] rt.cpan.org>
From: 楼颖 <louying [...] pwrd.com>
My demo program: #!/usr/bin/perl -w use List::MoreUtils qw(uniq); use DDP; use Tie::File; my @array; tie @array, 'Tie::File', 'd:\\a.out'; @array = qw ( 1603601,20150319 1600581,20150319 0300247,20150319 0300092,20150319 0002694,20150319 0002663,20150319 0002325,20150319 0002093,20150319 ); p @array; @array = uniq @array; p @array; -----邮件原件----- 发件人: Jens Rehsack via RT [mailto:bug-List-MoreUtils@rt.cpan.org] 发送时间: 2015年3月19日 19:38 收件人: 楼颖 主题: [rt.cpan.org #102885] uniq function bug <URL: https://rt.cpan.org/Ticket/Display.html?id=102885 > perl -MData::Dumper -MList::MoreUtils=uniq -e 'my @a = qw(1603601,20150319 1600581,20150319 0300247,20150319 0300092,20150319 0002694,20150319 0002663,20150319 0002325,20150319 0002093,20150319); print Dumper \@a; print Dumper [uniq @a]' $VAR1 = [ '1603601,20150319', '1600581,20150319', '0300247,20150319', '0300092,20150319', '0002694,20150319', '0002663,20150319', '0002325,20150319', '0002093,20150319' ]; $VAR1 = [ '1603601,20150319', '1600581,20150319', '0300247,20150319', '0300092,20150319', '0002694,20150319', '0002663,20150319', '0002325,20150319', '0002093,20150319' ]; I don't see any problem
Just for my knowledge - are you able to test from git repository (read: can I ask you for re-test before releasing)? The test case is good (uniq+Tie::Array behaves different ... as headline) - it's reproducible and easy to make a test in test suite from it. But just to be sure nothing hidden is included.
Subject: 答复: [rt.cpan.org #102885] uniq function bug
Date: Fri, 20 Mar 2015 15:20:05 +0800
To: <bug-List-MoreUtils [...] rt.cpan.org>
From: 楼颖 <louying [...] pwrd.com>
Dearl Jens Rehsack: I don’t' know what is your mean? It's not a bug? But it generate a unexpected result with uniq+Tie::Array. Or you tell what should I do next? Regards Jacky -----邮件原件----- 发件人: Jens Rehsack via RT [mailto:bug-List-MoreUtils@rt.cpan.org] 发送时间: 2015年3月20日 15:07 收件人: 楼颖 主题: [rt.cpan.org #102885] uniq function bug <URL: https://rt.cpan.org/Ticket/Display.html?id=102885 > Just for my knowledge - are you able to test from git repository (read: can I ask you for re-test before releasing)? The test case is good (uniq+Tie::Array behaves different ... as headline) - it's reproducible and easy to make a test in test suite from it. But just to be sure nothing hidden is included.
On Fri Mar 20 03:20:13 2015, louying@pwrd.com wrote: Show quoted text
> Dearl Jens Rehsack:
Hi, Show quoted text
> I don’t' know what is your mean? It's not a bug? But it generate a > unexpected result with uniq+Tie::Array.
I'd like to call it "uniq+Tie::Array behaves different" - as the name for the bug (because uniq is broken is kind-of indifferent ^^) Show quoted text
> Or you tell what should I do next?
Can you "git clone https://github.com/perl5-utils/List-MoreUtils.git" and run tests with that and your application (eg. starting your application with perl -Mblib=/path/to/LMU-repo yourapp.pl No worries when not - I could also send you a distfile just for you for testing only, if you want. When you're sure it's the only bug, this is not necessary. Show quoted text
> Regards > Jacky > > -----邮件原件----- > 发件人: Jens Rehsack via RT [mailto:bug-List-MoreUtils@rt.cpan.org] > 发送时间: 2015年3月20日 15:07 > 收件人: 楼颖 > 主题: [rt.cpan.org #102885] uniq function bug > > <URL: https://rt.cpan.org/Ticket/Display.html?id=102885 > > > Just for my knowledge - are you able to test from git repository > (read: can I ask you for re-test before releasing)? > > The test case is good (uniq+Tie::Array behaves different ... as > headline) - it's reproducible and easy to make a test in test suite > from it. But just to be sure nothing hidden is included.
Provide a fix with commit cab00af
Shipped 0.409_001 for testing
Subject: 答复: [rt.cpan.org #102885] uniq function bug - Tie::Array broken
Date: Mon, 23 Mar 2015 09:49:04 +0800
To: <bug-List-MoreUtils [...] rt.cpan.org>
From: 楼颖 <louying [...] pwrd.com>
I have downloaded and tested it(0.409_001) It seems that the problem is resolved. -----邮件原件----- 发件人: Jens Rehsack via RT [mailto:bug-List-MoreUtils@rt.cpan.org] 发送时间: 2015年3月22日 0:51 收件人: 楼颖 主题: [rt.cpan.org #102885] uniq function bug - Tie::Array broken <URL: https://rt.cpan.org/Ticket/Display.html?id=102885 > Shipped 0.409_001 for testing