我想使用now()函數在perl中顯示當前日期和時間。我使用Active Perl軟件運行此腳本,但出現錯誤。現在用於顯示不通過ActivePerl工作的日期和時間
#! /usr/bin/perl
use Date::Parse;
$date = str2time(now());
print "$date\n";
我得到的錯誤爲:
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.
請幫助。
如果你想要當前的Unix時間,爲什麼不使用['time'](http://perldoc.perl.org/functions/time.html「perldoc -f time」)? –