The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Tie::StorableDir - Perl extension for tying directories with Storable files

SYNOPSIS

  use Tie::StorableDir;
  
  tie %hash, 'Tie::StorableDir', dirname => 'foo/';
  $hash{foo} = 42;

DESCRIPTION

Tie::StorableDir is a module which ties hashes to a backing directory containing Storable.pm files. Any basic perl data type can be stored. Values retrieved from the hash are tied so changes will be written back either when all references to values under a key are removed, or the main hash is untied.

ON-DISK FORMAT

Each value in the hash is stored in a file under the directory passed as 'dirname' to tie, with a filename derived from the key as follows:

 * Prepend 'k'
 * Replace characters outside the set [a-zA-Z0-9. -] with _(hex code)

The format of the files themselves is that of a reference to the scalar value, serialized by Storable::store.

BUGS AND CAVEATS

  • This module will most likely break under taint mode.

  • Most filesystems impose a length limit on files and paths. This will restrict the maximum length of hash keys.

  • The hash must be untie-d before exiting, or data corruption may result.

AUTHOR

Bryan Donlan, <bdonlan@gmail.com>

SEE ALSO

Storable, perltie

COPYRIGHT AND LICENSE

Copyright (C) 2005 by Bryan Donlan

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.5 or, at your option, any later version of Perl 5 you may have available.