A
aswad
Hello, I've installed Perl 5.8.8 to use the DateTime module. Because I
need to subtract 2 dates to get the number of days difference. But I
cannot use the DateTime object. In all the examples I've seen, they are
using the new keyword. When I try this I get the following error: Can't
locate object method "new" via package "DateTime" (perhaps you forgot
to load "DateTime"?) at tt.pl line 17.
Can someone tell me what I'm doing wrong. Here is my code. Thanks.
use lib "C:\\Perl\\lib\\ActiveState";
my $dt1 = DateTime->new(year => 2002, month => 3, day => 1);
or
my $dt1 = DateTime->now();
need to subtract 2 dates to get the number of days difference. But I
cannot use the DateTime object. In all the examples I've seen, they are
using the new keyword. When I try this I get the following error: Can't
locate object method "new" via package "DateTime" (perhaps you forgot
to load "DateTime"?) at tt.pl line 17.
Can someone tell me what I'm doing wrong. Here is my code. Thanks.
use lib "C:\\Perl\\lib\\ActiveState";
my $dt1 = DateTime->new(year => 2002, month => 3, day => 1);
or
my $dt1 = DateTime->now();