There's a few things which could be going wrong. The most obvious one is that the dbmopen() call isn't opening the file. If the DBM file doesn't exist, rather than failing dbmopen() just makes a new one which could be why it appears empty.
To eliminate that possibility, make sure the DBM file does exist and is readable. You also want to check if the dbmopen() succeeded, it will (usually) error out if its the wrong format.
die "$art_dbm does not exist" unless -e $art_dbm;
die "Cannot read $art_dbm" unless -r $art_dbm;
dbmopen( %ARTS, $art_dbm, 0644 ) or die "dbmopen of $art_dbm failed: $!";
Unfortunately dbmopen() is too clever for its own good. If you give it "foo" it might create "foo.db" instead. Depends on the implementation. See below.
The other possibility is that your two Perls are trying to open the file with two different DBM implementations. Perl can be compiled with different sets of DBM implementations on your different machines. dbmopen() will use the first one in a hard coded (and historically barnacled) list. Its actually a wrapper around AnyDBM_File. You can check which implementation is being used with...
use AnyDBM_File;
print "@AnyDBM_File::ISA\n";
Make sure they're the same. If not, load the DBM library in question before using dbmopen. perldoc -f dbmopen
explains.
Here's a demonstration. First we see what dbmopen() will default to.
$ perl -wle 'use AnyDBM_File; print "@AnyDBM_File::ISA"'
NDBM_File
Then create and populate a dbm file.
$ perl -wle 'dbmopen(%foo, "tmpdbm", 0644) or die $!; $foo{23} = 42; print %foo'
2342
Now demonstrate we can read it.
$ perl -wle 'dbmopen(%foo, "tmpdbm", 0644) or die $!; print %foo'
2342
And try to read it using a different DBM implementation.
$ perl -wle 'use GDBM_File; dbmopen(%foo, "tmpdbm", 0644) or die $!; print %foo'
Nothing in the file, but no error either. Turns out it made a file called tmpdbm whereas ndbm was using tmpdbm.db. Let's try Berkeley DB.
$ perl -wle 'use DB_File; dbmopen(%foo, "tmpdbm", 0644) or die $!; print %foo'
Inappropriate file type or format at -e line 1.
At least that gives an error.
Your best bet is to figure out what DBM implementation the original machine is using and use that module before the dbmopen() call. That will make the situation static.
PS The Unix file
utility will also give you a good idea what type of DBM it is.
$ file tmpdbm
tmpdbm: GNU dbm 1.x or ndbm database, little endian
$ file tmpdbm.db
tmpdbm.db: Berkeley DB 1.85 (Hash, version 2, native byte-order)
And hope to $diety
its not a byte-order issue, less common now that almost everything is x86.
PPS As you can see, using DBM files is a bit of a mess. Strange considering its supposed to be just a hash-on-disk.