Subject: | DBM::Deep::Array::PUSH doesn't use "defined" |
Date: | Sat, 18 May 2013 14:36:10 +0100 |
To: | bug-DBM-Deep [...] rt.cpan.org |
From: | James Stanley <james [...] incoherency.co.uk> |
DBM::Deep::Array has:
sub PUSH {
##
# Add new element(s) to the end of the array
##
my $self = shift->_get_self;
$self->lock( $self->LOCK_EX );
my $length = $self->FETCHSIZE();
while (my $content = shift @_) {
$self->STORE( $length, $content );
$length++;
}
$self->unlock;
return $length;
}
the while loop test should be
while (defined (my $content = shift @_)) {
otherwise it is impossible to push 0's or empty strings to an array.
Regards,
James Stanley