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.