Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Re: sharing DBMs

by marvell (Pilgrim)
on Oct 04, 2002 at 12:48 UTC ( [id://202724]=note: print w/replies, xml ) Need Help??


in reply to Re: sharing DBMs
in thread sharing DBMs

Having read more into it, it appears my question is:

Is there a perl module that allows you to us the concurrent data model (many read, one write) model for Berkeley DB in a tie way?

That is to say, as one process writes, the other can read and it's there.

--
Steve Marvell

Replies are listed 'Best First'.
Re: Re: Re: sharing DBMs
by marvell (Pilgrim) on Oct 04, 2002 at 13:20 UTC

    After reading more, and playing, here it is:

    #!/usr/bin/perl -w use strict; use BerkeleyDB; use Data::Dumper; my $env = new BerkeleyDB::Env( -Home => '/home/steve/test', -Flags => DB_CREATE | DB_INIT_CDB | DB_INIT_MPOOL ) || die "env error: $! $BerkeleyDB::Error"; my $db = (tie my %hash, 'BerkeleyDB::Hash', -Filename => 'db2.bdb', -Env => $env, -Flags => DB_CREATE) || die "db error: $! $BerkeleyDB::Error"; while (<>) { $hash{$1} = $2 if (/(.*)=(.*)/); print Dumper \%hash; } undef $db; untie %hash;

    --
    Steve Marvell

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://202724]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2024-04-16 09:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found