DirDB::Storable - DirDB extended to pass complex things to Storable


DirDB-Storable documentation  | view source Contained in the DirDB-Storable distribution.

Index


NAME

Top

DirDB::Storable - DirDB extended to pass complex things to Storable

SYNOPSIS

Top

  use DirDB::Storable;
  tie my %PersistentData, 'DirDB', "./data";

DESCRIPTION

Top

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

RISKS

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
	}

TO DO

a set of Tie::Storable modules that the retreived stored objects could be tied to instead of the above-demonstrated hack would be cool.

EXPORT

None by default.

AUTHOR

Top

David Nicol, davidnicol@cpan.org

LICENSE

Top

GPL/Artistic (the same terms as Perl itself)

SEE ALSO

Top

l<DirDB>

better read l<perltie> before trying to extend this


DirDB-Storable documentation  | view source Contained in the DirDB-Storable distribution.