App-Stash

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN


        use App::Stash;
        $s=App::Stash->new({application => "test"});
        print $s->data->{'test'}, "\n";
        print $s->dao->test, "\n";

WARNING
    experimental, use on your own risk :-)

DESCRIPTION
    The purpose of the module is to transparently save stash data
    (structure) across application (script) execution. The save is done in
    DESTROY method. This has certain limitations. Basically make sure you
    never store object in the data as this one may get destroyed before
    App::Stash object does.

    The module+style is inspired by App::Cache. Unlike App::Cache it uses
    JSON::Util for storage and not Storable. The stash is saved to
    $HOME/.app-name/stash.json. It is in the "pretty" format so it should be
    easy to read and edit. I wanted to go with Storable but using it in
    DESTROY method causes `Segmentation fault' on my Perl.

lib/App/Stash.pm  view on Meta::CPAN

    $s=App::Stash->new({application => "test"});
    print $s->data->{'test'}, "\n";
    print $s->dao->test, "\n";

=head1 WARNING

experimental, use on your own risk :-)

=head1 DESCRIPTION

The purpose of the module is to transparently save stash data (structure)
across application (script) execution. The save is done in L</DESTROY>
method. This has certain limitations. Basically make sure you never store
object in the L</data> as this one may get destroyed before L<App::Stash>
object does.

The module+style is inspired by L<App::Cache>. Unlike L<App::Cache> it uses
L<JSON::Util> for storage and not L<Storable>. The stash is saved to
F<$HOME/.app-name/stash.json>. It is in the "pretty" format so it should be
easy to read and edit. I wanted to go with L<Storable> but using it in
DESTROY method causes C<Segmentation fault> on my Perl.



( run in 0.490 second using v1.01-cache-2.11-cpan-a1d94b6210f )