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

I have to redo something which I did a long time ago and I have forgotten the details. My goal is to have my own installation of Perl, install the DateTime module, and then use the DateTime module in my Perl code.

I have done the following commands:

setenv PERLBREW_ROOT /rhome/dotykg/perl5/perlbrew curl -L http://install.perlbrew.pl | bash perlbrew install-patchperl perlbrew install-cpanm perlbrew install perl-5.16.3

All of the above was successful and I currently have the Perl object at this directory path:

/rhome/dotykg/perl5/perlbrew/perls/perl-5.16.3/bin/perl

My first question is where in the above directory path do I perform this command:

cpanm DateTime

Then at the top of my Perl code I assume I need a minimum of the following:

#!/rhome/dotykg/perl5/perlbrew/perls/perl-5.16.3/bin/perl -w use strict; use DateTime;

This is actually my second attempt at this process. After my first attempt, even with a successful build of the DateTime module, the Perl code could not locate the latter module. So I am doing something incorrect somewhere. Thanks in advance for any guidance. Kevin Doty

Replies are listed 'Best First'.
Re: Installing DateTime
by stevieb (Canon) on Oct 28, 2016 at 16:18 UTC

    Do a perlbrew switch perl-5.16.3, and then call perl -v. You should now be running 5.16.3.

    Then, cpanm DateTime, then, try running your script with the perl command: perl script.pl. Does that work?

    Out of curiosity, why is it you're using 5.16? FYI, 5.24 is the most recent version.

      Thanks to you everything now works fine. It was the perlbrew switch part that I had missed. The only reason for using version 5.16.3 is that is the version my IT folks are using. Now that I know how do this I can update! Again thanks for the help. Kevin Doty