Searching the BerkeleyDB documentation for $! I imediately came accross
or die "Cannot open file $filename: $! $BerkeleyDB::Error\n" ;.
So, what does your $BerkeleyDB::Error say?
update: Try adding some flags
MJDsays "you can't just make shit up and expect the computer to know what you mean, retardo!"