Lux::IO - A Perl Interface to Lux IO
use Lux::IO; use Lux::IO::Btree; my $bt = Lux::IO::Btree->new(Lux::IO::CLUSTER); $bt->open('test', Lux::DB_CREAT); $bt->put('key', 'value', Lux::IO::OVERWRITE); #=> true $bt->get('key'); #=> 'value' $bt->del('key'); #=> true $bt->get('key'); #-> false $bt->close;
Lux IO is a yet another database manager. Lux::IO provides a Perl interface to it. You must note that it supports only BTree-based database so far, though Lux IO supports also hash-based database.
my $bt = Lux::IO::Btree->new(Lux::IO::CLUSTER);
Creates and returns a new Lux::IO::Btree object. $insert_type can be one of the types below:
$insert_type
over 4
* Lux::IO::CLUSTER
* Lux::IO::NONCLUSTER
back
$bt->open($filename, Lux::DB_CREAT);
Opens a database specified by $filename. $oflags can be one of or a combination of the flags below:
$filename
$oflags
* Lux::DB_RDONLY
* Lux::DB_RDWR
* Lux::DB_CREAT
* Lux::DB_TRUNC
$bt->close();
Closes the database.
$bt->get($key);
Retrieves a value which is correspondent to the $key from the database.
$key
$bt->put($key, $value, Lux::IO::OVERWRITE);
Stores the key-value pair into the database. $insert_mode can be one of the modes below:
$insert_mode
* Lux::IO::OVERWRITE
* Lux::IO::NOOVERWRITE
* Lux::IO::APPEND
$bt->del($key);
Deletes the value which is correspondent to the $key.
Lux IO
http://luxio.sourceforge.net/
Kentaro Kuribayashi <kentaro@cpan.org>
Tokuhiro Matsuno for much improvement of the codes.
Copyright (c) Kentaro Kuribayashi <kentaro@cpan.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
7 POD Errors
The following errors were encountered while parsing the POD:
You can't have =items (as at line 51) unless the first thing after the =over is an =item
You can't have =items (as at line 70) unless the first thing after the =over is an =item
You can't have =items (as at line 114) unless the first thing after the =over is an =item
'=item' outside of any '=over'
You forgot a '=back' before '=head1'
To install Lux::IO, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Lux::IO
CPAN shell
perl -MCPAN -e shell install Lux::IO
For more information on module installation, please visit the detailed CPAN module installation guide.