Click here to get back home

Can't locate object method "ymd" via package...

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Can't locate object method "ymd" via package... Luis Angel Fdez. Fdez. 08-03-2007
Posted by Luis Angel Fdez. Fdez. on August 3, 2007, 6:14 am
Please log in for more thread options


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.


Posted by Sisyphus on August 3, 2007, 8:34 am
Please log in for more thread options



.
.
> #!/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


Posted by Luis Angel Fdez. Fdez. on August 3, 2007, 8:51 am
Please log in for more thread options


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!


Posted by Luis Angel Fdez. Fdez. on August 3, 2007, 11:58 am
Please log in for more thread options


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!.


Similar ThreadsPosted
Can't locate object method "new" via package "Net::SMTP" November 2, 2004, 6:36 pm
Can't locate object method "blocking" via package "IO::Handle" June 20, 2005, 8:38 am
Can't locate object method "newFromJpeg" via package "GD::Image" December 19, 2005, 3:03 am
ant locate object method _session_channel via package Net::SSH::Perl::SSH1 July 13, 2006, 6:05 pm
Cant locate object method _session_channel via package Net::SSH::Perl::SSH1 July 13, 2006, 6:15 pm
Pg.pm Question - Can't locate object method driver October 31, 2004, 9:17 pm
GD::Image: Can't locate object method "newFromJpeg" April 1, 2005, 2:51 am
Tk::Browser, "Can't locate object method 'Construct'" January 16, 2008, 4:47 am
How to get GIF support with Perl-GD library? (Can't locate object method "newFromGif") June 5, 2007, 4:22 am
Can't locate loadable object August 4, 2005, 12:18 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap