Greetings
I am a little problem that I just can't figure out at this stage. Please see
the following code:
#!/bin/perl
#
#
#
use strict;
use BerkeleyDB;
my $password = "password1";
my $base = "/test";
my $log_file = $base . "/log/db.log";
my $db_filename = $base . "/joe.db";
my $db_env = new BerkeleyDB::Env
-Config => {DB_DATA_DIR => $base . "/data",
DB_LOG_DIR => $base . "/logs",
DB_TMP_DIR => $base . "/tmp"
}
-Flags => DB_CREATE,
-ErrFile => $log_file,
-Encrypt => { Password => $password, Flags => DB_ENCRYPT_AES };
my $db = new BerkeleyDB::Hash
-Filename => $db_filename,
-Flags => DB_CREATE,
-Env => $db_env
or die "Cannot open file $db_filename: $! $BerkeleyDB::Error\n" ;
undef $db ;
print "Done!";
When this executes, the joe.db file is not created in the correct directory as
specified in the ENV (created in current directory). In fact, it seems like my
whole ENV is not set at all because if I create a db, write some data to it and
try change the pw I can still retrieve the data with the incorrect password.
What am I missing?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>