Subject: | scalar(@array) returns incorrect value after shift() on tied array |
Example:
use strict;
use BerkeleyDB;
my $db = tie my @array, 'BerkeleyDB::Recno',
'-Flags' => DB_CREATE|DB_TRUNCATE;
push @array, 1,2,3;
print "ndata = ", $db->db_stat->{bt_ndata}, " scalar = ",
scalar(@array), "\n";
shift @array;
print "ndata = ", $db->db_stat->{bt_ndata}, " scalar = ",
scalar(@array), "\n";
__END__
Output is:
ndata = 3 scalar = 3
ndata = 2 scalar = 3
db_stat() returns correct information, but scalar(@array) always returns
value as it was before first shift. BerkeleyDB::Queue has same behaviour.