Skip Menu |

This queue is for tickets about the Queue-Base CPAN distribution.

Report information
The Basics
Id: 53729
Status: resolved
Priority: 0/
Queue: Queue-Base

People
Owner: Nobody in particular
Requestors: user42 [...] zip.com.au
Cc:
AdminCc:

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



Subject: remove() of 0 when wantarray
Date: Sat, 16 Jan 2010 08:26:55 +1100
To: bug-Queue-Base [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
With Queue::Base 1.1 and debian i386 perl 5.10.1, a program use strict; use warnings; use Queue::Base; my $q = Queue::Base->new([0,10,20]); my @elems = $q->remove(2); print "remove count ",scalar(@elems),"\n"; prints "remove count 0", where I expected it to be "remove count 2", having asked to remove two elements. I suspect the remove() wantarray case could be something like "return splice @{list}, 0, $numOfElements" instead of a loop.
Hi Kevin, On Fri Jan 15 16:27:27 2010, user42@zip.com.au wrote: Show quoted text
> With Queue::Base 1.1 and debian i386 perl 5.10.1, a program > > use strict; > use warnings; > use Queue::Base; > > my $q = Queue::Base->new([0,10,20]); > my @elems = $q->remove(2); > print "remove count ",scalar(@elems),"\n"; > > prints "remove count 0", where I expected it to be "remove count 2", > having asked to remove two elements. > > I suspect the remove() wantarray case could be something like > "return splice @{list}, 0, $numOfElements" instead of a loop.
The former maintainer is nowhere to be found. I have been granted co- maintainer status by the beginning of this year. The problem you reported is no longer happening in the latest (2.200) version. Thanks for reporting! Cheers, Alexei