#!perl use DB_File; use Fcntl; # For the constants O_RDWR and O_CREAT use strict; use warnings; ## master file name my $cryptofile = "crypt.qap"; ## create Berkeley DB my %cryptohash; my %testhash; tie (%testhash, 'DB_File', undef, O_RDWR|O_CREAT, 0644, $DB_BTREE) or die "Database error: $!"; $testhash{'this'} = "hello"; print $testhash{'hello'}; tie (%cryptohash, 'DB_File', $cryptofile, O_RDWR|O_CREAT, 0644, $DB_BTREE) or die "Database error: $!"; %cryptohash = %testhash; untie %cryptohash; untie %testhash;