Can"t locate object method "ymd" via package...
am 03.08.2007 12:14:42 von laffdez
Hi!
I've installed DateTime and DateTime::Format::MySQL via CPAN and I
get a strange error message executing this code:
#!/usr/bin/perl -w
use strict;
use DateTime;
use DateTime::Format::MySQL;
my $str = "2007-08-03";
my $mySQLdate = DateTime::Format::MySQL->new;
my $parsed = DateTime::Format::MySQL->format_date($mySQLdate);
The error message I get is:
Can't locate object method "ymd" via package "DateTime::Format::MySQL"
at /usr/lib/perl5/site_perl/5.8.8/DateTime/Format/MySQL.pm line 84.
Does anybody knows why I get this error message?
Thanks in advance.
Bye.
Re: Can"t locate object method "ymd" via package...
am 03.08.2007 14:34:32 von Sisyphus
"Luis Angel Fdez. Fdez." wrote in message
news:1186136082.884701.203570@w3g2000hsg.googlegroups.com...
..
..
> #!/usr/bin/perl -w
>
> use strict;
>
> use DateTime;
> use DateTime::Format::MySQL;
>
> my $str = "2007-08-03";
>
> my $mySQLdate = DateTime::Format::MySQL->new;
> my $parsed = DateTime::Format::MySQL->format_date($mySQLdate);
>
> The error message I get is:
>
> Can't locate object method "ymd" via package "DateTime::Format::MySQL"
> at /usr/lib/perl5/site_perl/5.8.8/DateTime/Format/MySQL.pm line 84.
>
> Does anybody knows why I get this error message?
>
format_date() calls the ymd method, which appears to be defined in
DateTime.pm. Perhaps you have an old outdated version of DateTime - one that
doesn't define the ymd method ?
Didn't you get the same error when running 'make test' ? The test file
t/01format.t calls format_date(), and should therefore have produced the
same failure.
Cheers,
Rob
Re: Can"t locate object method "ymd" via package...
am 03.08.2007 14:51:16 von laffdez
Hi!
> format_date() calls the ymd method, which appears to be defined in
> DateTime.pm. Perhaps you have an old outdated version of DateTime - one that
> doesn't define the ymd method ?
I've installed it today trough perl -MCPAN -e shell. I did it in two
different computers which before installation the script says...
Can't locate DateTime.pm in @INC (@INC contains: /usr/lib/perl5/5.8.8/
i486-linux /usr/lib/perl5/5.8.8 /usr/lib/perl5/site_perl/5.8.8/i486-
linux /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl .) at ./
dateTest.pl line 5.
So I think it isn't a double installation problem.
> Didn't you get the same error when running 'make test' ? The test file
> t/01format.t calls format_date(), and should therefore have produced the
> same failure.
I don't see any failure in installation process. Every tests seems
to be ok.
Bye!