Vyacheslav Matyukhin > Ubic-1.51 > Ubic::Persistent

Download:
Ubic-1.51.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 1.51   Source   Latest Release: Ubic-1.57

NAME ^

Ubic::Persistent - simple hash-to-file persistence object

VERSION ^

version 1.51

SYNOPSIS ^

    use Ubic::Persistent;
    $obj = Ubic::Persistent->new($file); # create object and lock it
    $obj->{x} = 'y';
    $obj->commit; # atomically save file

    $data = Ubic::Persistent->load($file); # { x => 'y' }

METHODS ^

Ubic::Persistent->load($file)

Class method. Load data from file without obtaining lock.

Ubic::Persistent->new($file)

Construct new persistent object. It will contain all data from file.

Data will be locked all the time this object exists.

$obj->commit()

Write data back on disk.

AUTHOR ^

Vyacheslav Matyukhin <mmcleric@yandex-team.ru>

COPYRIGHT AND LICENSE ^

This software is copyright (c) 2013 by Yandex LLC.

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

syntax highlighting: