Viktor Turskyi
and 1 contributors


Hash::Storage - Persistent Hash Storage Framework


    my $st = Hash::Storage->new(
        driver => [ OneFile => { serializer => 'JSON', file => '/tmp/t.json' } ]

    # Store hash by id
    $st->set( 'user1' => { name => 'Viktor', gender => 'M', age => '28' } );

    # Get hash by id
    my $user_data = $st->get('user1');

    # Delete hash by id


Hash::Storage is a multipurpose storage for hash. You can consider Hash::Storage object as a collection of hashes. You can use it for storing users, sessions and a lot more data.

Hash::Storage has pluggable architecture, therefore you can use different drivers or write you own.


Hash::Storage->new(driver => $DRIVER)

$DRIVER is an arrayref with two values: the first is a driver name, the second is a hashref with options for driver.

    my $st = Hash::Storage->new(
        driver => [ OneFile => { serializer => 'JSON', file => '/tmp/t.json' } ]

$DRIVER - also can be a Hash::Storage driver object

    my $drv = Hash::Storage::Driver::OneFile->new({ serializer => 'JSON', file => '/tmp/t.json' });
    my $st = Hash::Storage->new( driver => $drv );

$SELF->set($ID, \%HASH);

Saves hash


Retrieves hash


Deletes hash


returns array with hashrefs


returns number of hashes in a collection


"koorchik", <"koorchik at">


Please report any bugs or feature requests to bug-hash-storage at, or through the web interface at I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.


You can find documentation for this module with the perldoc command.

    perldoc Hash::Storage

You can also look for information at:



Copyright 2012 "koorchik".

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See for more information.