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

NAME

App::TeleGramma::Store - Persistent datastore for TeleGramma and plugins

VERSION

version 0.12

SYNOPSIS

  my $store = App::TeleGramma::Store->new(path => "/some/dir");
  my $hashref1 = $store->hash('mydata-1');
  $hashref1->{foo} = 'bar';
  $hashref1->{bar} = 'baz';
  $store->save('mydata-1');  # persisted

  my $hashref2 = $store->hash('mydata-2'); # new data structure
  $hashref2->{users} = [ qw/ a b c / ];

  $store->save_all;  # persist data in both the 'mydata1' hash and the 'mydata2' hash

METHODS

hash

Return the hash reference for a named entry in your data store. Note that the names become disk filenames, and thus must consist of alphanumeric characters or '-' only.

save

Save a named hash to the data store.

References are saved using Storable and the limitations in terms of data stored can be found in that documenation.

In general, if you stick with simple hashrefs, arrayrefs and scalars you will be fine.

save_all

Persist all named hashrefs to the store at once.

AUTHOR

Justin Hawkins <justin@eatmorecode.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2017 by Justin Hawkins <justin@eatmorecode.com>.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.