NAME
Ubic::Persistent - simple hash-to-file persistence object
VERSION
version 1.60
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) 2016 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.