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

I'm "trying" to install CPAN's Date::Calc module on my system and not having much success. Anyone have the exact steps needed to do this? I tried unzipping the folder (~ Date-Calc-5.5.1) into the Perl/lib directory on my Windows machine. I tried running the Makefile.pl in that directory but when trying to "use" it in Komodo it underlines it in red to signify it can't find it. Any help would be greatly appreciated.

Replies are listed 'Best First'.
Re: How to Install Date::Calc
by JavaFan (Canon) on Oct 17, 2008 at 20:57 UTC
    If you're installing by hand, running Makefile.PL is just the first step. Running Makefile.PL will generate a Makefile, which allows you to do "make", "make test" and "make install".

    But this is all explained in the INSTALL.txt file that comes with Date::Calc.

      If you're running ActiveState Perl or something else with ppm support, the fastest thing to do is add the Bribes or Trouchelle repositories to your list, and then ppm install date-calc or use the graphical installer to select and install.

        Likely an elementary question for you guys but here goes... I typed in ppm and got the graphical installer and selected Date::Calc and the other couple of modules it required. I'm using Komodo and the line use Date::Calc; not longer gets underlined with a red line saying it can't find the module. When I try running my CGI application it throws a Software Error saying : "Can't locate Date/Calc.pm in @INC....". I'm currently doing a search to find the Calc.pm file but if it's in another directory how can I move it into Perl/lib directory? Any additional steps other than copy/paste? If this isn't preferred what's the easiest way to leave it where it is? I'm using ActiveState's PerlApp application to compile my .pl CGI application so I'm not sure if it would "bundle" the Date::Calc if I just added whatever directory it's in to @ISA. Thanks for the help so far and I'd appreciate even more on the added questions. Rob
Re: How to Install Date::Calc
by Perlbotics (Archbishop) on Oct 18, 2008 at 11:01 UTC

    You could unzip the module in a temporary directory and call perl Makefile.PL PREFIX=xxx LIB=xxx where xxx might be ~/lib or a non-standard directory where you have sufficient permission, followed by the usual mantra (see JavaFan's response). In-depth description can be found for example in this tutorial.

    You can use lib (preferred) or call perl with the -I switch, or set the environment variable PERL5LIB or PERLLIB to xxx so your programs will find the non-standard xxx directory. The latter method affects all your Perl programs (might have undesired side effects, e.g. concerning security or module versions visible), the first two limit the effect to the programs invoked.

    Komodo might need to learn a non-standard xxx directory first, e.g. Edit -> Preferences -> Languages -> Perl -> Additional Perl Import Directories (*nix, but Windows should be similar).

Re: How to Install Date::Calc
by rpike (Scribe) on Oct 20, 2008 at 15:43 UTC
    Hopefully someone in here can answer this questions : 1) if I install Activestate v. 5.8 should I install into a different directory than Perl or should I remove the version of perl on the server currently and then install v. 5.8 into the Perl directory? 2) if I should install into a separate directory for v. 5.8 how can I add the directory for Perl 5.8 automatically to @ISA? When I go into ppm I want to add Date::Calc and have it go into the directory with version 5.8 or the latest version of perl I have. 3) when doing a perl -v command it comes back with version 5.6. If I were to have multiple copies of perl (different versions) what would come back then? Where does it look to get that information? Thanks again.