BerkeleyDB::Easy::Cursor - Cursor to database handle
Most of the functionaly for BerkeleyDB cursors are crammed into a few underlying functions, with the behavior specified by a flag. For example, to get the next record, you call `c_get` and provide the `DB_NEXT` flag. In this module, these are split out into individual wrapper methods, and the required flag is provided for you. You can specify additional flags and they will be OR'ed together with the default.
Get the first record.
($key, $val) = $cursor->first();
Get the last record.
($key, $val) = $cursor->last();
Get the next record.
($key, $val) = $cursor->next();
Move the previous record.
($key, $val) = $cursor->prev();
Get the record at the current position.
($key, $val) = $cursor->current();
Position the cursor to the specified key.
($key, $val) = $cursor->set($key);
Set the next record to the specified value. Returns true on success.
$bool = $cursor->after($val);
Set the previous record to the specified value.
$bool = $cursor->before($val);
Replace the record at the current position.
$bool = $cursor->replace($val);
Delete the current record.
$bool = $cursor->del();
Close the cursor.
$bool = $cursor->close();
This module is functional but unfinished, and not currently being worked on.
Rob Schaber, <robschaber at gmail.com>
<robschaber at gmail.com>
Copyright 2013 Rob Schaber.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install BerkeleyDB::Easy, copy and paste the appropriate command in to your terminal.
cpanm
cpanm BerkeleyDB::Easy
CPAN shell
perl -MCPAN -e shell install BerkeleyDB::Easy
For more information on module installation, please visit the detailed CPAN module installation guide.