in reply to dbmopen not opening a db file

Based on your description of what is happening, DB_File really thinks that the file is empty. There are many ways in which this could have happened, including your having the wrong file, the person who created it having messed up, the result of a software conflict between the old and the current version of BerkeleyDB, the person who created it didn't have what you think was on the machine so dbmopen fell back (through AnyDBM_File) to a different dbm implementation than you think it did, the file that you think you're loading is not in the location that you're opening, etc, etc, etc. I have no way to know which of these is happening. I can only tell you that as far as dbmopen is concerned, you don't have data in the file being opened.

As for using tie, it is a small change. Change the dbmopen line to:

use DB_File; tie %TEST, 'DB_File', '/home/lab/access.db';
and if there is a dbmclose line, just call untie.

The change is tiny. The advantage is that you guarantee that you aren't creating with one dbm and then trying to read with another later. If what you've said is correct, though, it likely won't help you. But you should try to use tie and try out each of NDBM_File, SDBM_File and ODBM_file to see if it is in one of those formats. (Type perldoc X to see if X is installed and to find out how to try using it.)

If all else fails, then chalk this up to lessons learned - always have a plaintext backup that you can restore critical data from.