This is of no help in figuring out your current problem but may be of interest for the future. Were you aware that the
DBI distribution now includes
DBD::DBM? This module provides a DBI/SQL front-end to any DBM file including DB_File and BerkeleyDB either with or without MLDBM and using your choice of serializer. Naturally, SQL provides a number of comparison operators so, at a minimum, you could check your file (without converting it) with DBD::DBM, just to make sure it has in it what you expect.