Subject: | Shifting arrayref out of arrayref leaves empty slot |
The only difference between these two runs is an inner pair of square
brackets. Both runs should yield an empty array in the hash entry, but
this doesn't happen when the thing being shifted out is an array ref itself.
$ perl -MDBM::Deep -MData::Dumper -le '$db = DBM::Deep->new("/tm
p/db"); $db->{ghi} = [ 42 ]; shift @{ $db->{ghi} }; $db->optimize; print
scalar @{ $db->{ghi} }; print Dumper $db->{ghi}'
0
$VAR1 = bless( [], 'DBM::Deep::Array' );
$ perl -MDBM::Deep -MData::Dumper -le '$db = DBM::Deep->new("/tmp/db");
$db->{ghi} = [ [42] ]; shift @{ $db->{ghi} }; $db->optimize; print
scalar @{ $db->{ghi} }; print Dumper $db->{ghi}'
1
$VAR1 = bless( [
undef
], 'DBM::Deep::Array' );
Verified with 5.8.8 on Solaris 2.9 and 5.10.0 on Linux.