saintex has asked for the wisdom of the Perl Monks concerning the following question:
Hello Monks,
I have a problem with Storable and MLDb... substantially, because I have not confidence with these modules.
I use a mailing list software that I love, but I have a problem with data format.
This software store data not with a RDBM database, but using MLDb and Storable.
I need to create a connector (I can: this software is Open Source) in order to connect it to my personal website, but I'm not able to manipulate data with those two modules.
Ok, I go to the code,
That software use:
If you are interesting in, the modules are these ones:
MLDb.pm
Schedules.pm
I need to read the generated files, in order to write or append there some data.
I tried in several way to read that file, but without success.
For example with:
Please, someone can help me?
Thank you very much.
I have a problem with Storable and MLDb... substantially, because I have not confidence with these modules.
I use a mailing list software that I love, but I have a problem with data format.
This software store data not with a RDBM database, but using MLDb and Storable.
I need to create a connector (I can: this software is Open Source) in order to connect it to my personal website, but I'm not able to manipulate data with those two modules.
Ok, I go to the code,
That software use:
and these are some rows, the software use to store data:use Fcntl qw( O_WRONLY O_TRUNC O_CREAT O_CREAT O_RDWR O_RDONLY LOCK_EX LOCK_SH LOCK_NB); use MLDBM qw(AnyDBM_File Storable);
then with that row, it read the file:my $dbm = tie %{$self->{DB_HASH}}, 'MLDBM', $self->_db_filename, O_CRE +AT|O_RDWR, FILE_CHMOD
I think these are all the rows involved in data storage.sysopen(DB_SCHEDULE_SAFETYLOCK, $self->_lockfile_name, O_RDWR|O_CREAT +, FILE_CHMOD )
If you are interesting in, the modules are these ones:
MLDb.pm
Schedules.pm
I need to read the generated files, in order to write or append there some data.
I tried in several way to read that file, but without success.
For example with:
In addition I don't understand (and that is probably the problem) what MLDb does and how Storable and MLDb work together.use MLDBM qw(AnyDBM_File Storable); use Storable qw(retrieve_fd); use Fcntl qw (:DEFAULT :flock); use FindBin qw($Bin); tie (%hash, "MLDBM", $Bin.'mj-test-schedules', O_CREAT|O_RDWR, 0666) or die $!; # sysopen(DB_SCHEDULE_SAFETYLOCK, $Bin.'/mj-test-schedules', O_RDW +R|O_CREAT, 0666); #open FILE, ">", $Bin.'/filename.txt' or die $!; open (DF,$Bin.'/mj-test-schedules') or die $!; flock (DF, LOCK_SH) or die $!; $href=retrieve_fd(*DF); close DF; while ( my ($key, $value) = each(%$href) ) { print "$key => $value\n"; } #print FILE $_ while (<DB_SCHEDULE_SAFETYLOCK>) ; #close FILE; untie %hash;
Please, someone can help me?
Thank you very much.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Storable and MLDb
by tokpela (Chaplain) on Nov 18, 2010 at 19:25 UTC | |
by saintex (Scribe) on Nov 19, 2010 at 14:07 UTC |
Back to
Seekers of Perl Wisdom