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

Not sure how to fix this problem. I was trying to run a script that been running fine for some time and I started getting errors about missing modules. A few I've been able to install, some others won't. Carp and DBD::Oracle in particular. For DBD::Oracle, I get this message:
dbdimp.c:1211: error: `OCI_ATTR_MODULE' undeclared (first use in this +function) dbdimp.c: At top level: dbdimp.c:34: warning: 'dbi_get_state' defined but not used make: *** [dbdimp.o] Error 1 PYTHIAN/DBD-Oracle-1.44.tar.gz /usr/bin/make -- NOT OK CPAN: YAML loaded ok (v0.81) Running make test Can't test without successful make Running make install Make had returned bad status, install seems impossible
For Carp, I get this:
CPAN: File::Temp loaded ok (v0.22) CPAN: Parse::CPAN::Meta loaded ok (v1.4401) CPAN: CPAN::Meta loaded ok (v2.110930) CPAN: Module::CoreList loaded ok (v2.44) CPAN.pm: Building Z/ZE/ZEFRAM/Carp-1.26.tar.gz Checking if your kit is complete... Looks good Undefined subroutine &Carp::longmess_heavy called at /usr/lib/perl5/5. +8.8/Carp.p m line 239. Warning: No success on command[/usr/bin/perl Makefile.PL] ZEFRAM/Carp-1.26.tar.gz /usr/bin/perl Makefile.PL -- NOT OK Running make test Make had some problems, won't test Running make install Make had some problems, won't install Could not read metadata file. Falling back to other methods to determi +ne prerequisites
I tried to force the install, cpan -f install DBD::Oracle, but I get the same message. I even tried reinstalling Perl, but no joy. Please help.

Replies are listed 'Best First'.
Re: Perl installation broken
by syphilis (Archbishop) on Jun 22, 2012 at 01:07 UTC
    Undefined subroutine &Carp::longmess_heavy called at /usr/lib/perl5/5. +8.8/Carp.pm line 239. Warning: No success on command[/usr/bin/perl Makefile.PL] ZEFRAM/Carp-1.26.tar.gz /usr/bin/perl Makefile.PL -- NOT OK
    AFAICT, you should be getting that same failure *every* time you do a cpan install ... and it puzzles me how *any* cpan install could ever succeed while that broken version of Carp is being found.

    Every time 'perl Makefile.PL' gets run, ExtUtils/MakeMaker.pm is loaded and it, in turn, loads that broken version of Carp - at which point the build fails.
    I presume the problem there is that /usr/lib/perl5/5.8.8/Carp/Heavy.pm, which should define the longmess_heavy sub, is either corrupted or not being loaded - and the best way I can see of fixing this would be to manually copy'n'paste Heavy.pm (from the source distro) to the location that I've just specified. Maybe you should also copy Carp.pm from the source distro to /usr/lib/perl5/5.8.8/Carp.pm (just to make sure that you have matching versions of Carp.pm and Heavy.pm).

    However, I believe this is the *system* perl that you're tampering with, and I'm always a bit nervous when it comes to doing that lest the system gets broken.
    It would be far preferable that you install and use a different perl (say, /usr/local/perl) and leave the system perl well alone.

    Cheers,
    Rob
      Greetings,

      Along the same lines Rob mentioned above && assuming a *NIX system;
      building and installing a miniperl into your ~ (/home/) might be useful
      to have around. When building && installing, use --prefix /home, or /home/lib, or
      whatever seems appropriate given the layout you keep in your $home. ;)
      Then anytime you run into trouble -- or want to experiment with something, you only need
      to change your environment's PATH to ensure that your HOME version of perl (or lib) comes
      Before the system's version. This should allow you to build a replacement version of CARP
      (again using the correct --prefix (/usr/lib || /usr/local/lib)), and install it.

      Good luck! Hope this helps. :)

      use perl::always;
      my $perl_version = "5.12.4";
      print $perl_version;
Re: Perl installation broken
by cavac (Prior) on Jun 24, 2012 at 18:42 UTC

    Are you really running a very old version of perl (5.8.8 in this case)? Or do you just load old modules from a stale INC path?

    Also, make sure you have an Oracle client library version installed that matches what the DBD::Oracle supports. If you really are running 5.8.8, it's very likely (from my own experience) you are also using an old version of the Oracle client libs.

    Check out WHICH VERSION OF DBD::ORACLE IS FOR ME?. Quote: "From version 1.25 onwards DBD::Oracle only support Oracle clients 9.2 or greater. Support for ProC connections was dropped in 1.29".

    If you really need an older version of DBD::Oracle, check out Backpan

    "You have reached the Monastery. All our helpdesk monks are busy at the moment. Please press "1" to instantly donate 10 currency units for a good cause or press "2" to hang up. Or you can dial "12" to get connected directly to second level support."
Re: Perl installation broken
by Anonymous Monk on Jun 21, 2012 at 16:57 UTC
    Read the various readmes that come with DBD::Oracle, export the required vars
Re: Perl installation broken
by locked_user sundialsvc4 (Abbot) on Jun 22, 2012 at 19:09 UTC

    I do not have a complete answer for you here, but check your environment variables carefully.   PERL5LIB and PATH, in particular.   Also check that the CPAN configuration (o conf) matches it.

    On Linux boxes, these variables are usually set by the .profile script; Windows uses a more-obscure system setting.   I almost always forget to do source .profile in Linux after I change that script, so that the changes occur in my current session.