Asher Blum > DB-SPEEDYB-0.1 > DB::SPEEDYB

Download:
DB-SPEEDYB-0.1.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Module Version: 0.1   Source  

NAME ^

DB::SPEEDYB - Look up records in a Speedyb constant database

SYNOPSIS ^

use DB::SPEEDYB;

    my $db = DB::SPEEDYB->new();
    $db->open('tiny.db') or die "Failed to open db: $!";
    my $res = $db->get("Alice");

    while (my($k,$v) = $DB->each()) {
        ...
    }

DESCRIPTION ^

This module performs lookups in a Speedyb constant database. Currently, you must create the database with the Python speedyb module.

Speedyb is a high performance, memory-mapped key-value store.

You can share a speedyb handle across forked child processes. There are no locking issues.

Functions

open($filename);

Open the file for reading.

get($key);

Return the value for this key, or undef if not found. Only strings are supported as keys and values.

each()

Iterate over all items in the database, returning $key, $value. Returns undef when items are exhausted.

ERRORS

Open returns undef on failure. get returns undef if they keys is not found.

HISTORY ^

Written by Asher Blum <asher@wildsparx.com> and Robert Lehr in 2012.

COPYRIGHT ^

Copyright (C) 2012 Asher Blum and Robert Lehr. All rights reserved. This code is free software; you can redistribute it and/or modify it under the same terms as Perl itself

syntax highlighting: