1

I am using Perl for the first time, and I need to use the DateTime class to parse timestamps, compare timestamps, etc. However, I found that it is not included with Perl (I am using Strawberry 5.26.1.1) and needs to be separately downloaded and installed. After spending some time googling, I am still not sure where to download and how to install. I tried the following but it does not work. I have already set the http_proxy, http_proxy_user and http_proxy_pass variables.

PPM interactive shell (11.11_03) - type 'help' for available commands.
PPM> install DateTime
Install package 'DateTime?' (y/N): y
Installing package 'DateTime'...
Error installing package 'DateTime': Could not locate a PPD file for package DateTime
PPM>

Thanks.

user3573403
  • 1,780
  • 5
  • 38
  • 64
  • 1
    With Strawbery, the `cpan` command should work. https://stackoverflow.com/q/6643939/1030675 – choroba Mar 26 '18 at 09:01
  • Interesting that you have a PPM on a Strawberry Perl. I thought that's ActivePerl only. Do you also have an ActivePerl installed? – simbabque Mar 26 '18 at 09:11
  • run `cpan install DateTime` from Command Prompt – flamey Mar 26 '18 at 09:43
  • 1
    `Time::Piece` is core, and should be included. That might do what you want. – Sobrique Mar 26 '18 at 09:59
  • Download the module from [here](http://search.cpan.org/~drolsky/DateTime-1.47/lib/DateTime.pm) and try to install by using these [steps](https://stackoverflow.com/questions/7541019/manual-installation-of-a-perl-module) – mkHun Mar 26 '18 at 10:30
  • 1
    @flamey actually it's `cpan DateTime`. The `install` is only needed when you are _in the CPAN shell_. In fact, your command tells `cpan` to install two modules. [install](https://metacpan.org/pod/install) and [DateTime](https://metacpan.org/pod/DateTime). :) – simbabque Mar 26 '18 at 10:55
  • Hi everyone, I tried with "cpan DateTime" and "cpan DateTime::Format::Strptime" and had successfully installed the modules. Thanks. – user3573403 Mar 27 '18 at 02:24
  • 1
    @simbabque thanks, didn't realize it! I install any modules from cpan shell. – flamey Mar 28 '18 at 12:03

0 Answers0