Hub::Data::HashFile - Flat file data which supports nested perl structures.
Part of the Hub Library
use Hub; my $hf = Hub::mkinst('HashFile','myfile.hf'); $hf->set( "eye_color", "green" ); # set a simple property $hf->save(); # saves the file to disk
HashFiles are used for property files and small databases.
There will be one and only one HashFile instance for each file. If a second HashFile instance is created and is asked to load a file which is already represented, this second instance is replaced with a reference to the first.
D E P R I C A T E D
depricated, please use method data()
Static methods
Sync all modified instances to disk
Read and parse the file from disk.
This is a singleton per filename.
Usage: refresh
Sync disk data into ourselves Hub object method
Usage: setOption KEY VALUE
Sets an option for this instance.
KEY can be:
preserve_comments 0 or 1, We will write out comments backup Set the number of backups you want to keep write_behind 0 or 1, Do not write to disk on save() but mark it as dirty, and defer to the hfsync() method.
Usage: AUTOLOAD
Data handlers: getv takev setv appendv
Usage: DESTROY
Defining this function prevents it from being searched in AUTOLOAD
Ryan Gies
Copyright (c) 2006 Livesite Networks, LLC. All rights reserved.
Copyright (c) 2000-2005 Ryan Gies. All rights reserved.
This file created by mkdocs.pl on 8/29/2006 at 2:07pm
To install Hub, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Hub
CPAN shell
perl -MCPAN -e shell install Hub
For more information on module installation, please visit the detailed CPAN module installation guide.