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).
>
>