Reputation: 351
I want to display the present date and time in perl using now() function. I am running this script using Active Perl software but I am getting error.
#! /usr/bin/perl
use Date::Parse;
$date = str2time(now());
print "$date\n";
I am getting error as:
C:\Users\admin\Desktop>perl test.pl
Can't locate Date/Parse.pm in @INC (@INC contains: C:/Perl/site/lib C:/Perl/lib
.) at test.pl line 3.
BEGIN failed--compilation aborted at test.pl line 3.
Please help.
Upvotes: 1
Views: 785
Reputation: 116387
You do not have module Date::Parse
installed by default in ActivePerl.
You can fix this with:
ppm install Date::Parse
This works for me for ActivePerl 5.16 default install.
Upvotes: 6