Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Re: Re: sharing DBMs

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


in reply to Re: Re: sharing DBMs
in thread sharing DBMs

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://202736]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-04-25 09:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found