Subject: | clear() leaves one key unless there's only one |
Following program illustrates that clear() leaves one key in unless
there's only one there:
use strict;
use warnings;
use DBM::Deep;
unlink '/tmp/foo.db';
my $db = DBM::Deep->new ('/tmp/foo.db' );
$db->{block} = { };
$db->{critical} = { };
$db->{minor} = { };
$db->clear;
print "Now have " . keys(%$db) . " key\n";
$db->clear;
print "Now have " . keys(%$db) . " keys\n";
__END__
Output:
Now have 1 key
Now have 0 keys
Verified on Fedora Core 9 and Solaris 9.