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

Esteemed monks,

my colleagues and me are trying to get a foreign script running under Perl 5.8.8. As far as we know the script was developed under a Perl version <= 5.8.8, and among some other modules it uses GDBM_File. Since this module is not yet part of our installation we tried to install it via a CPAN shell. However, as it seems - and searching the CPAN for "GDBM_File" confirmed that impression - the current version 1.09 of this module is available only as part of David A. P. Mitchell's perl-5.10.1 distribution.

I also couldn't find any earlier versions (preferably usable under 5.8.8) of GDBM_File on CPAN so here's my humble question: Do we really have to upgrade to Perl 5.10 in order to be able to use GDBM_File;?

Kind regards and thanks for links to any documentation I might have overlooked so far
Locutus

  • Comment on How to install a CPAN module which is only available as part of a comprehensive Perl distribution?
  • Select or Download Code

Replies are listed 'Best First'.
Re: How to install a CPAN module which is only available as part of a comprehensive Perl distribution?
by moritz (Cardinal) on Sep 30, 2009 at 15:42 UTC
    With some luck you might be able to build GDBM_File with an older perl. Just obtain the ext/GDBM_File directory from a newer perl, and try
    perl Makefile.PL make test make install

    in that directory ("make install" might need root privs)

    Perl 6 - links to (nearly) everything that is Perl 6.
Re: How to install a CPAN module which is only available as part of a comprehensive Perl distribution?
by almut (Canon) on Sep 30, 2009 at 16:36 UTC

    Note that for the suggested build to succeed, you'll also need to have the gdbm library and header files installed. And in case they are not in standard places, you'd need to run

    perl Makefile.PL INC=-I/path/to/nonstandard/include LIBS='-L/path/to/n +onstandard/lib -lgdbm'

    And if you want to run the tests, comment out line 6

    @INC = '../lib';

    in t/gdbm.t before running make test  (setting @INC to ../lib is designed to work in the context of building GDBM_File as a core module during the normal build of the entire Perl distribution... — without the change, you'd get "Can't locate Config.pm in @INC").

    Other than that, things should work fine with 5.8.8 (just tried it).

Re: How to install a CPAN module which is only available as part of a comprehensive Perl distribution?
by Anonymous Monk on Sep 30, 2009 at 15:37 UTC
    Replace GDBM_File with AnyDBM_File, and the script should run, or download these files , and run Makefile.PL...
    http://cpansearch.perl.org/src/DAPM/perl-5.10.1/ext/GDBM_File/GDBM_Fil +e.pm http://cpansearch.perl.org/src/DAPM/perl-5.10.1/ext/GDBM_File/GDBM_Fil +e.xs http://cpansearch.perl.org/src/DAPM/perl-5.10.1/ext/GDBM_File/Makefile +.PL http://cpansearch.perl.org/src/DAPM/perl-5.10.1/ext/GDBM_File/typemap http://cpansearch.perl.org/src/DAPM/perl-5.10.1/ext/GDBM_File/hints http://cpansearch.perl.org/src/DAPM/perl-5.10.1/ext/GDBM_File/hints/sc +o.pl http://cpansearch.perl.org/src/DAPM/perl-5.10.1/ext/GDBM_File/t http://cpansearch.perl.org/src/DAPM/perl-5.10.1/ext/GDBM_File/t/gdbm.t
Re: How to install a CPAN module which is only available as part of a comprehensive Perl distribution?
by Locutus (Beadle) on Oct 01, 2009 at 09:38 UTC
    Thanks, fellow monks, for all your valuable suggestions!

    In the meantime one of my colleagues also found her way to a GDBM_File for 5.8.8: On the distribution page for perl-5.10.1 the dropdown menu "Other Releases" allows to select version 5.8.8 and from that distribution's page you only have to follow the corresponding link to version 1.08 of GDBM_File.

    This, of course, raises (at least) three further questions:

    1. Why doesn't CPAN offer any way to navigate directly from the latest to earlier versions of GDBM_File?
    2. Why is a CPAN shell started in a 5.8.8 environment (i.e. where the version of the Perl interpreter running the shell is 5.8.8) not automatically referred to the latest version of GDBM_File which is still compatible with 5.8.8 but instead tries to install the globally latest version which requires (by resolution of dependencies) an update of Perl itself?
    3. Is GDBM_File supposed to be a core module at the end of the day? - At least the link "Dependencies" on the left margin of the module's documentation page leads to a result page that says so. (But then how did our sysops manage to in install a Perl 5.8.8 without one of the core modules???)
    Curious regards
    Locutus
      GDBM_File is core, but only builds if you have the necessary libraries and headers available.
      GDBM_file is a core module, and v1.08 is the version that you want. Evidently, your sysops chose not to install it because it must be specifically configured when you install perl, otherwise it isn't installed. Have you consulted with them?
        Evidence of Locutus working in spite of the best efforts of the/some BOFH ??

        :-D

        A user level that continues to overstate my experience :-))
      I think that this is an appropriate point to whine about CPAN. Often I cannot install or upgrade modules from CPAN because my installation has 5.10.0 and CPAN only sees the most recent 5.10.1 version. Why doesn't CPAN only look for modules that can be installed, unless told otherwise? Or at least have an option to do so?

      Whew! I feel much better now.