in reply to what is anydbm_file?

Yes AnyDBM_File will use whichever is available. If you just use 'AnyDBM_File' as the tie type, it will look for things in the order specified in the POD. But DB_File is also fairly easy to install.
my %h; tie(%h, 'AnyDBM_File', $file, $mode, 0666) or die "Couldn't tie DBM file '$file': $!; aborting";
That will use whatever's available selecting in the order specified in the POD if several are available. You can set the @INC for AnyDBM_File if you prefer say GDBM over NDBM.