From c51a300c48dda3b29b7268debbd41e319d719147 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 1 Jul 2009 17:12:03 +0200 Subject: Simplestore: Added some documentation --- lib/Simplestore.pm | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) (limited to 'lib/Simplestore.pm') diff --git a/lib/Simplestore.pm b/lib/Simplestore.pm index 7885449..1369d87 100755 --- a/lib/Simplestore.pm +++ b/lib/Simplestore.pm @@ -43,3 +43,55 @@ sub save { } 1; + +__END__ + +=head1 NAME + +Simplestore - simple storage format for hash refs + +=head1 SYNOPSIS + + + use Simplestore; + + # somefile contains: + # word purrl + # foo eggs + my $hash = load('somefile'); + say $hash->{word}; # purrl + + $hash->{foo} = 'bar'; + $hash->{word} = "Yeah, this is more thon one\nword, I know"; + save('somefile', $hash); + + # somefile contains: + # word Yeah, this is more than one + # word word, I know + # foo bar + +=head1 DESCRIPTION + +B is a perl library to store hashes in a very simple, +easy-to-parse file format. + +=head1 FUNCTIONS + +=over + +=item B(I [, I]) + +Load the hash saved in I. Returns a hash ref containing the hash +saved in I. + +If I is specified, I will not be loaded into an empty hash, +but into I. However, keys in I overwrite those in I. + +=item B(I, I) + +save I in I. Returns nothing. + +=head1 COPYRIGHT + +Copyright (C) 2009 by Daniel Friesel. +Licensed under the terms of the WTFPL . -- cgit v1.2.3