Berkeley newbie question - cannot tie database
I'm trying to tie a V3 Berkeley DB loaded from a V3 text export using the v4. db_load utility. When I do a db_dump it lists the version as 3 and the database dumps fine
I have the perl libraries for Berekeley v4.
I have tried the following two methods of tying w/ no luck:
#####################################
#!/usr/bin/perl
use BerkeleyDB::Hash;
my %hash;
tie %hash, 'BerkeleyDB::Hash', -Filename => $ARGV[0]
or die "can't read file '$ARGV[0]': $!";
print map { " $_ => $hash{$_}\n" } sort keys %hash;
#####################################
which gets :Bad File Descriptor
and
#####################################
use DBI;
use DB_File;
my $dbmfile="mydb.db";
use BerkeleyDB;
#0444
$DB = tie %DB, 'DB_File', $dbmfile, O_RDONLY, 0444, $DB_File::DB_HASH
|| die "Can't tie $dbmfile: $!\n";
#####################################
which gets "Can't read file 'mydb.db'
Any pointers would be appreciated.