For Programmers: Free Programming Magazines  


Home > Archive > PERL Modules > August 2007 > Can't locate object method "ymd" via package...









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Can't locate object method "ymd" via package...
Luis Angel Fdez. Fdez.

2007-08-03, 7:58 am

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.

Sisyphus

2007-08-03, 7:58 am


"Luis Angel Fdez. Fdez." <laffdez@gmail.com> 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

Luis Angel Fdez. Fdez.

2007-08-03, 7:58 am

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!

Luis Angel Fdez. Fdez.

2007-08-03, 7:01 pm

Hi!

I did the tests again (both DateTime and DateTime::Format::MySQL) and
every test gives me ok. Only...
* t/23storable............ok

.... are skipped.

Bye!.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com