musterion has asked for the wisdom of the Perl Monks concerning the following question:

version 5.12.2 now includes GDBM_File as part of the bundle, but I cannot seem to conjure perl correctly to get it to work. First, do you or do you not need to add:

use GDBM_File;
I added this and I get: Can't locate GDBM_File.pm in @INC I tried without the use and I got: Undefined subroutine &main::GDBM_READER called at Affinity/test_loaded_gdbm.pl line 44. my environment is a local perl 5.12.2 build under ~/local with the following structure:
drwxrwxr-x 11 thompson thompson 4096 Dec 27 11:05 ./ drwxr-xr-x 19 thompson thompson 20480 Dec 27 12:51 ../ drwxrwxr-x 2 thompson thompson 4096 Dec 27 11:04 bin/ drwxrwxr-x 4 thompson thompson 4096 Dec 27 10:25 html/ drwxrwxr-x 2 thompson thompson 4096 Dec 23 10:40 include/ drwxrwxr-x 2 thompson thompson 4096 Dec 23 10:40 info/ drwxrwxr-x 3 thompson thompson 4096 Dec 23 13:43 lib/ drwxr-xr-x 4 thompson thompson 4096 Dec 23 09:41 man/ drwxr-xr-x 34 thompson thompson 12288 Dec 27 11:05 perl/ drwxrwxr-x 2 thompson thompson 4096 Jul 20 14:44 scripts/ drwxrwxr-x 3 thompson thompson 4096 Dec 27 11:05 src/
I find the .pm in: ./perl/ext/GDBM_File/GDBM_File.pm with the Makefile.PL and stuff to build it.

Is there, perhaps a separate step to add this?

Please answer here or email to thompson_at_oclc_dot_org

replace _at_ and _dot_ as required

Replies are listed 'Best First'.
Re: GDBM_File and 5.12.2
by Khen1950fx (Canon) on Dec 27, 2010 at 23:18 UTC
    GDBM_File is part of the core, but it has its own unique installation procedures. It's almost like a dual-lived module, but it's not dual-lived because it can't be downloaded separately from perl.

    The first thing to do is to make sure that you have libgdbm which you can get from www.gnu.org. Then manually install GDBM_File. It can be found in the ext directory.

    As I understand it, many organizations don't have gdbm and don't want it in order to conserve space and to protect their systems from overzealous users, so GDBM_File isn't automatically installed with perl.

      Thanks for all of your help. It turns out that we have a somewhat defective installation of the OS. I had to basically do what Khen1950fx said and hand edit the makefile to find gdbm.h which was the problem (I finally quit being lazy and read the output of the make).
Re: GDBM_File and 5.12.2
by toolic (Bishop) on Dec 27, 2010 at 20:04 UTC