DirDB::Storable - DirDB extended to pass complex things to Storable
use DirDB::Storable; tie my %PersistentData, 'DirDB', "./data";
DirDB::Storable is an extended version of DirDB data persistence tool that uses the Storable module to store and retreive data that is other than scalars and hash references.
tie my %d => DirDB, '/tmp/foodb'; $d{ref1}->{ref2}->{ref3}->{ref4} = 'something'; # 'something' is now stored in /tmp/foodb/ref1/ref2/ref3/ref4 $d{ref5} = [1..99]; # an array reference, with data, is now stored in /tmp/foodb/ref5/\ Storable
Besides the potential stale lock problem with DirDB, there is a risk of confusion about what is and isn't tied into the persistence framework.
$d{ref5}->[33] = 'cheese'; # not written out { my $tmp = $d{ref5}; $tmp->[33] = 'cheese'; $d{ref5} = $tmp; # a work-around }
a set of Tie::Storable modules that the retreived stored objects could be tied to instead of the above-demonstrated hack would be cool.
None by default.
David Nicol, davidnicol@cpan.org
GPL/Artistic (the same terms as Perl itself)
l<DirDB>
better read l<perltie> before trying to extend this
To install DirDB::Storable, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DirDB::Storable
CPAN shell
perl -MCPAN -e shell install DirDB::Storable
For more information on module installation, please visit the detailed CPAN module installation guide.