in reply to Which DBM implementation?

If you can log in to the server, write a short program like:
dbmopen(%FOO, "hlag", 0666) || die;
And then run it with the debugger. Step THROUGH the dbmopen and you'll see things like:
4: our @ISA = qw(NDBM_File DB_File GDBM_File SDBM_File ODBM_File) + unless @ISA; nyDBM_File::(/usr/local/lib/perl5/5.6.0/AnyDBM_File.pm:6): 6: my $mod; nyDBM_File::(/usr/local/lib/perl5/5.6.0/AnyDBM_File.pm:7): 7: for $mod (@ISA) { nyDBM_File::(/usr/local/lib/perl5/5.6.0/AnyDBM_File.pm:8): 8: if (eval "require $mod") {
AnyDBM is going to step through that @ISA array to find which database is available. The one where the eval works, is the one that you're using.

There are more hackish ways of doing this like looking at %INC after the dbmopen to see what got brought in successfully.

Replies are listed 'Best First'.
Re: Re: Which DBM implementation?
by tomazos (Deacon) on Jun 12, 2001 at 19:28 UTC
    I am not calling use, I am just going straight in with dbmopen. The code is:
    $FILENAME = "/blah/blah/test" dbmopen %HASH, $FILENAME, 0666 or die; foreach $key (sort keys %HASH) { print $key, ' = ', $HASH{$key}, "\n"; } dbmclose %HASH;
    When I step through the above dbmopen with perl -d it goes into:

      /usr/lib/perl5/AnyDBM_File

    and that appears to go into:

      /usr/lib/perl5/i386-linux/DB_File.pm

    Am I to understand that this means that it is using the Berkeley DB implementation?

    Update: I'm pretty sure I have figured out that the answer to the above question is yes. Thanks all.