Skip Menu |

This queue is for tickets about the DBM-Deep CPAN distribution.

Report information
The Basics
Id: 14893
Status: resolved
Worked: 1 hour (60 min)
Priority: 0/
Queue: DBM-Deep

People
Owner: RKINYON [...] cpan.org
Requestors: belg4mit [...] MIT.EDU
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.92
Fixed in: (no value)



Subject: tie options bug
The dox state: As with the OO constructor, you can replace the DB filename parameter with a hash containing one or more options (see OPTIONS just below for the complete list). tie %hash, "DBM::Deep", { file => "foo.db", locking => 1, autoflush => 1 }; However when attempting this (on win32) it simply creates a new file named the stringified (options) hash reference. It looks the current code expects a flat list of options for tie. (diff'd 0.92 to 0.94 and the bug is still there).
From: jhuckaby [...] cpan.org
Yeah, that's not entirely surprising. The tie() interface is depreciated. I highly recommend you use the OO interface instead. In the meantime I'll try to fix the bug. Thanks! - Joe [guest - Mon Oct 3 13:01:39 2005]: Show quoted text
> The dox state: > > As with the OO constructor, you can replace the DB filename > parameter > with a hash containing one or more options (see OPTIONS just
below Show quoted text
> for > the complete list). > > tie %hash, "DBM::Deep", { > file => "foo.db", > locking => 1, > autoflush => 1 > }; > > However when attempting this (on win32) it simply creates a new file > named > the stringified (options) hash reference. It looks the current code > expects > a flat list of options for tie. (diff'd 0.92 to 0.94 and the bug is > still there).
From: jhuckaby [...] cpan.org
Show quoted text
> Yes, I see that the OO interface is recommended. Why, I don't know
since Show quoted text
> OO is overkill and according to new it's just a wrapper for tie
anyhow. If you use the OO interface you get an actual blessed hash reference which you can call methods on. DBM::Deep provides a bunch of methods that provide features a plain tie() cannot give you. When using tie() you get a plain hash that is not blessed. Show quoted text
> Also, one minor nit is the necessity to assign an empty anonymous
hash Show quoted text
> before being able to set second-level values... It seems as though > the module could do that for me with exists?
Ah yes, the famous Perl autovivication bug. This appears to be a bug in Perl iteslf, not in DBM::Deep, but I am still looking into it. Apparently other DBM modules including MLDBM have this same problem. I haven't tried Perl 5.9 yet -- perhaps its fixed. Thanks! - Joe [guest - Mon Oct 3 13:39:30 2005]: Show quoted text
> Yeah, that's not entirely surprising. The tie() interface is > depreciated. I highly recommend you use the OO interface instead.
In Show quoted text
> the meantime I'll try to fix the bug. Thanks! > > - Joe > > > > [guest - Mon Oct 3 13:01:39 2005]: >
> > The dox state: > > > > As with the OO constructor, you can replace the DB filename > > parameter > > with a hash containing one or more options (see OPTIONS just
> below
> > for > > the complete list). > > > > tie %hash, "DBM::Deep", { > > file => "foo.db", > > locking => 1, > > autoflush => 1 > > }; > > > > However when attempting this (on win32) it simply creates a new
file Show quoted text
> > named > > the stringified (options) hash reference. It looks the current code > > expects > > a flat list of options for tie. (diff'd 0.92 to 0.94 and the bug is > > still there).
> >
This was fixed in either 0.97 or 0.98 (I forget).