Remember::Anything::AsPath - remember objects seen by a specific created id in a folder structure
version 0.01
use Remember::Anything::AsPath; my $book = { url => 'www.books.de/3', name => 'I <3 perl', price => 999, }; my $brain = Remember::Anything::AsPath->new( tree_depth => $some_int # 1, only file directly, 2 one folder then file .... # default is 2 digest_sub => sub { # return pathfriendly checksum of string # on default this is sha1_hex }, out_dir => 'where/to/start/with/tree' # default '.' ); # remember $book object in $brain->remember($book); if ($brain->seen($another_book) { # discard? ... } else { # save push @books, $another_book; }
Remember $anything in a tree of folders and empty files.
$brain->remember($anything);
Remember $antything in the filesystem. $anything will be hashed and saved in a tree of folders and one empty file.
Example for tree_depth of 2:
$anything -> $hashed_id -> out_dir/$id_part_1/$id_part_2/$id_part_3
$brain->seen($anything);
Checks if there is an existing file path for the hashed id of $anything. If $anything has been remembered before it will return 1, otherwise 0.
ac0vs dirty and beautiful way of avoiding a database.
This is released under the Artistic License.
spebern <bernhard@specht.net>
To install Remember::Anything::AsPath, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Remember::Anything::AsPath
CPAN shell
perl -MCPAN -e shell install Remember::Anything::AsPath
For more information on module installation, please visit the detailed CPAN module installation guide.