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

I have recompile the standard package of Perl 5.6.0 to 5.8.0 on my Mac OS X box. When I was upgrading some modules I noticed that a module call File::Spec::Functions went from 1.1 to 1.2 and that 1.2 is included in the 5.8.0. My problem is if I had already installed 5.8.0 why wasn't the module also upgraded and how can I fix this without recompiling the source again? Any help would be appreciated.

Replies are listed 'Best First'.
Re: Perl 5.8.0 and Mac OS X
by chromatic (Archbishop) on Mar 12, 2003 at 19:19 UTC

    I'm not sure I understand the question completely, so I apologize in advance if this is unhelpful.

    Different versions of Perl, by default, do not share installed modules. This is for two very good reasons. First, the internals of Perl can change between releases. Any compiled module, such as DBI, may or may not work without being recompiled for the other version. If modules were shared, you'd get hard-to-debug missing symbol errors. Second, core modules are allowed to depend on new features introduced in that version of Perl. Several core modules in 5.8 use the our keyword introduced in 5.6.0. Using those modules on an earlier version would cause syntax errors.

    In this case, a lot of the work done to File::Spec and friends improved portability on platforms like VMS (and Mac OS 9, I believe). If version 1.1 works fine for you, I'd suggest sticking with it.

      Thanks...for the info. It hasn't hurt my scripts so far.
Re: Perl 5.8.0 and Mac OS X
by ChemBoy (Priest) on Mar 12, 2003 at 19:30 UTC

    Like chromatic, I'm slightly unsure about the nature of the problem, so feel free to post a clarification in this thread if this isn't the answer you need. That said, I recall an issue that matches up with your complaint when I did roughly what you've just done (upgraded to 5.8.0). The problem was that the lib path started in the wrong place: the previous version of the module (in /System/Library, as I recall) was being found before the more recently installed one (which was probably in /Library, off the top of my head).

    The non-recompiling solution was to set PERL5LIB in your environment to the directory your 5.8.0 modules were installed in (/Library/Perl, if my guesses above are right)--it's probably being searched already, so this will make it be searched twice in under certain circumstances, but this is not, I assure you, a significant performance issue. ;-)

    I'll post an update with the correct paths when I get home tonight, if those aren't they. Good luck!

    Update: as it happens, those were they, but I figured I'd update anyway to relieve the minds of any future readers. The relevant output of perl -V is

    %ENV: PERL5LIB="/Library/Perl" @INC: /Library/Perl/darwin /Library/Perl /System/Library/Perl/darwin /System/Library/Perl /Library/Perl/darwin /Library/Perl /Library/Perl /Network/Library/Perl/darwin /Network/Library/Perl /Network/Library/Perl .



    If God had meant us to fly, he would *never* have given us the railroads.
        --Michael Flanders

Re: Perl 5.8.0 and Mac OS X
by Cabrion (Friar) on Mar 13, 2003 at 00:19 UTC
    You may run into a lot of that. I'm guessing that's an XS (complied C) module that broke when you upgraded. After doing the upgrade, it's worth while to do . . .
    # sudo perl -MCPAN -erecompile
    . . . to get all your XS modules updated.

    Did you follow Apple's 5.8 upgrade instructions? If so, did you do a parallel install alongside 5.6 or did you opt to replace it alltogether?

      I followed Apples instructions for upgrading to 5.8 it when I'm in the CPAN module and request what needs to be recompiled it spits out that File::Spec::Functions has been upgraded to 1.2 and that the module is in perl-5.8.0.tar.gz which is why I'm puzzled why I'm getting that for just that module.