Subject: | documented syntax OpenDB($hash) does nothing |
In attached code, you will see that both blobs of code are in fact accessing the same database.
It appears when OpenDB($hash) is called, it does nothing with that value:
https://metacpan.org/source/SORTIZ/LMDB_File-0.05/lib/LMDB_File.pm#L232
Note how "$name" is not used anywhere when it *is* a hash? :P
Subject: | lmdb.pl |
#!/usr/bin/env perl
# FILENAME: lmdb.pl
# CREATED: 09/07/14 15:02:41 by Kent Fredric (kentnl) <kentfredric@gmail.com>
# ABSTRACT: Make sure I get this.
use strict;
use warnings;
use utf8;
use LMDB_File qw( :dbflags :cursor_op );
mkdir '/tmp/some_path';
{
my $env = LMDB::Env->new('/tmp/some_path', { maxdbs => 1024 } );
my $txn = $env->BeginTxn;
$txn->AutoCommit(1);
my $db = $txn->OpenDB( { dbname => "FIRST NAMESPACE", flags => MDB_CREATE, } );
eval { $db->del( "test1", undef ); };
$db->put("test1","Hello World");
}
{
my $env = LMDB::Env->new('/tmp/some_path', { maxdbs => 1024 });
my $txn = $env->BeginTxn;
$txn->AutoCommit(1);
my $db = $txn->OpenDB( { dbname => "SECOND NAMESPACE", flags => MDB_CREATE, } );
printf "%s\n", $db->get("test1");
}