-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
> > It looks like MLDBM expects the first 'use' parameter to be the DB
> > package, and the second to be the serializer, although I don't think
> > that is made very clear in the documentation. At least, that would be my
> > guess from a quick look at the import function.
> >
> > See the examples in the documentation. They either have no 'use'
> > parameters or 2, e.g.
> >
> > use MLDBM qw(DB_File Storable);
I'll try reversing the parameters then; thanks!
> >
> > Either that, or try the UseDB and/or Serializer methods.
> >
> > As an aside, it does seem quite old. Untouched for over 5 years. Still,
> > if it does the job ...
> >
> ### New reply - not sure why Brian's emails don't automatically get >
> indented?? ###
>
> I had a similar issue with this some time back - the code which I was
using
> (from someone elses example script) was:
>
> eval {
> BEGIN { @AnyDBM_File::ISA = qw(DB_File GDBM_File SDBM_File) };
> use AnyDBM_File;
> use MLDBM qw(AnyDBM_File Storable);
> use Fcntl qw(:DEFAULT :flock);
> };
>
> but it was fixed by installing DB_File. I don't really understand what is
> going on though.
>
> For what its worth I have since used DBM::Deep in similar situations
which I
> found much simpler.
>
> Mark
I have also been using DBM::Deep for awhile, however recently I've been
running into trouble with it, coupled with Data::Compare.
I have a database that I use to store information about all the
workstations I manage. Recently, I added pulling the local user
information, which is returned as a hash by Win32API. Storing this as
an additional element to the arrays stored in the DBM::Deep hash is not
a problem, but when I try to compare newly acquired data (in a regular
hash data structure) with the stuff stored in the DBM::Deep database,
Data::Compare returns a false (non-match) even when the data is
identical. I traced it to the fact that the database hash references
are 'DBM::Deep::Hash' types, and that Data::Compare does not compare
them correctly with normal (complex) hash structures.
Writing a plug-in for Data::Compare to correctly handle DBM::Deep
references might be good, but I don't think I'm up to the task yet.
Copying the hash structure from the DBM::Deep database does not fix the
problem; all references remain pointed to the db. I tried to 'cheat' by
assigning the temporary new information to the database, which allows
the compare to work correctly, but then when trying to update the
original database entry, I get a 'Cannot store tied value' because the
references are already set to point to another part of the db.
So, in looking for help on the perl beginners list ([EMAIL PROTECTED]),
I was advised to try a different database and serialize it. Which
leaves me with the above error.
Also I learned today (from writing the DBM::Deep maintainer) that the
way to handle the tied references is to use DBM::Deep's export(), though
this exports the entire database, which is not really what I would like
to do... but, if I cannot get another db to work, I will likely give up
and go that route.
</story>
If you're curious, you can see my prior attempts in the
[EMAIL PROTECTED] mail archive.
I also have tried using BerkeleyDB::Hash with FreezeThaw and MLDBM, but
that is giving me a different error entirely (cannot create second-level
tie or somesuch; I don't have it in front of me at the moment)
End result, my simple script change has been a week of bugs instead...
though, I'm learning more about Perl at least. :)
Any suggestions appreciated.
Regards,
Roman
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.7 (GNU/Linux)
iD8DBQFHh9mff1ZCgXADleARCuVyAKClPaABw4Pzd+1hT0vb8m04agEVLACfXup/
IOUUPc77NSYYjujA1SxiGOM=
=//qg
-----END PGP SIGNATURE-----
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs