NAME

DirDB - Perl extension to use a directory as a database

SYNOPSIS

use DirDB;
tie my %session, 'DirDB', "./data/session";

DESCRIPTION

DirDB is a package that lets you access a directory as a hash. The final directory will be created, but not the whole path to it.

DirDB will croak if it can't open an existing file system entity, so wrap your fetches in eval blocks if there are possibilities of permissions problems. Or better yet rewrite it into DirDB::nonfragile and publish that.

subdirectories become references to tied objects of this type, but this is a read-only function at this time.

pipes and so on are opened for reading and read from on FETCH, and clobbered on STORE. This may change but not immediately.

The underlying object is a scalar containing the path to the directory. Keys are names within the directory, values are the contents of the files.

If anyone cares to benchmark DirDB on ReiserFS against Berkeley DB for databases of verious sizes, please send me the results and I will include them here.

EXPORT

None by default.

AUTHOR

David Nicol, davidnicol@cpan.org

Assistance

QA provided by members of Kansas City Perl Mongers, including Andrew Moore and Craig S. Cottingham.

LICENSE

GPL