File::Dir::Hash - Relieve the stress on your filesystem by making arbitrarily large trees to store otherwise non hierarchical data
File::Dir::Hash is a simple object and tries to be configurable to how you wish to index your directory.
Creates a new instance. It takes a hash of options. Valid keys are:
This is a coderef which will 'hash' your filenames/whatever. This doesn't have to return a hash or even anything other than the string itself. It is called with the input to "genpath". If ommited, will use md5_hex from Digest::MD5
This determines how the index will split the key. This is an arrayref of integers. The 'hash' is split as many times as there are elements in the array, with each split being the size of the value of that element.
Thus if the
hash_funcreturns 'ABCEFGHIJKLMOPQRST' and the
[1,2,5]then the resultant path would be
A/BC/EFGHI/JKLMNOPQRST. The default pattern is
This is the base directory. Nothing to see here, move along.
Tries to generate a path based on arbitrary input in
$key(passed to "hash_func") and optionally creates the path (but not the last component, assumed to be a filename), if
$mkdiris set to true.
Use this at your own risk. API and options might change.
AUTHOR AND COPYRIGHT
Copyright 2011 M. Nunberg