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

I think i've confused my perl install. my scripts so far have been simple but i have recently discovered using some of the CPAN mods. i use scite's passer to check code before putting on the server.. worked fine up until now.
i got the DateTime mod from the ubuntu repos. then discovered CPAN shell. so i updated the module from there as the reop version was 0.35..

"perldoc perllocal" gives

Fri Mar 20 14:48:10 2009: "Module" DateTime · "installed into: /usr/local/share/perl/5.8.8" · "LINKTYPE: dynamic" · "VERSION: 0.47" · "EXE_FILES: "
but when i pass my code i get.. DateTime::Locale version 0.4 required--this is only version 0.35 at /usr/local/share/perl/5.8.8/DateTime.pm line 46.

anyidea how to get out of this.. i imagine i need to append @INC some how.. but how do i work out what path should i remove and what should i add..??
@INC looks like this now...

/etc/perl /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl
thanks in advance..
beware the farmers.

Replies are listed 'Best First'.
Re: CPAN.pl... hmmm..
by ig (Vicar) on Mar 25, 2009 at 05:32 UTC

    DateTime::Locale and DateTime are two different modules. You have found from perldoc perllocal that module DateTime is at version 0.47, but what about module DateTime::Locale?

    Can you update module DateTime::Locale?

    It can be difficult mixing modules from distribution packages with modules installed directly from cpan. You might think about installing all your modules from packages.To fix the ones already installed (if they are broken by conflicts) you can force a re-install of the package from the repo. If you want to install modules from CPAN yourself (e.g. the packages are not as up-to-date as you want to be) you should build and install your own perl. It takes a bit of time but it isn't very difficult.

      I'd second that, choose repository or CPAN. The first module I get in is CPANPLUS.

      The advantage to packages is it will bring in non Perl/CPAN dependencies like libraries and tools and the installer can plop them in as root for you. I also find that some modules don't build very well in CPANPLUS. I tend to use CPANPLUS to grab the code then build them manually. This is often due to being behind a firewall so testing fails or sometimes with accessing databases. (The worst was Math::PARI and needing to build the pari lib on Solaris 8)

      crikey!! i see now.. thanks for the advice.. as you stay i may stick to the repos if i can. finding the CPAN mods has been a revelation (ie.. i use to pass all my data by hand instead of using the CGI mod). but it's frustrating getting it to work localy.
      beware the farmers.
        Maybe that was just a poor example, but if you have to go to CPAN to get CGI.pm, then you probably haven't had repos to grab from either. CGI has come 'in the box' with Perl for quite a while now I think.
Re: CPAN.pl... hmmm..
by svenXY (Deacon) on Mar 25, 2009 at 11:49 UTC
    Hi,
    just a side note: It may well be worth building your own distro packages from the cpan modules if you need them on many machines (as I do).

    I have recently found cpan2dist (which is in CPANPLUS) to be of great value and it has a supplemental module (CPANPLUS::Dist::Deb) for creating Debian packages (also used for Ubuntu) with cpan2dist.
    Regards,
    svenXY
      thanks everybody for their feedback and suggestions.. i think i'll try sticking to repos.. i tried to use CPAN to install imagemagic on my machine, but it did not work.. image magic works fine on my web host though. so i tend to continually upload and look at 500 errors until things work (not very good, but it gets things done). actually now that i think of it, my example was shitty.. i don't ever recall installing the CGI mod -smiles to self- today is a new cup of coffee and a fresh start though...
      beware the farmers.
        well i have not managed to fix the problem.. the repos dont have a version that wan't to work DateTime::Locale 0.35 only

        i try to use CPAN to install 0.42 but i just get streams of complaints. i must have not installed CPAN properly or something.

        it's going to be a long day -frowns-

        beware the farmers.