in reply to dbmopen() test if file exists already?

Try
dbmopen(%my_hash,'my_data',undef) || die "$!";