Subject: | format_datetime fails with error message |
Error message is:
Can't call method "ymd" without a package or object reference
at /usr/local/share/perl/5.8.4/DateTime/Format/MySQL.pm line 84.
Below is a script to show the error, my Perl -V output, and output of
the cpan test for your module.
Thanks!
__PERL__
my $dt = '2007-06-26T08:23:16';
my $rv;
eval { $rv = DateTime::Format::MySQL->format_date( $dt ); };
warn $rv;
warn $@;
eval { warn DateTime::Format::MySQL->format_time( $dt );};
warn $rv;
warn $@;
eval { warn DateTime::Format::MySQL->format_datetime( $dt );};
warn $rv;
warn $@;
__END__
Summary of my perl5 (revision 5 version 8 subversion 4) configuration:
Platform:
osname=linux, osvers=2.6.15.6, archname=i386-linux-thread-multi
uname='linux ernie 2.6.15.6 #1 thu mar 16 13:11:55 est 2006 i686
gnulinux '
config_args='-Dusethreads -Duselargefiles -Dccflags=-DDEBIAN -
Dcccdlflags=-fPIC -Darchname=i386-linux -Dprefix=/usr -
Dprivlib=/usr/share/perl/5.8 -Darchlib=/usr/lib/perl/5.8 -
Dvendorprefix=/usr -Dvendorlib=/usr/share/perl5 -
Dvendorarch=/usr/lib/perl5 -Dsiteprefix=/usr/local -
Dsitelib=/usr/local/share/perl/5.8.4 -
Dsitearch=/usr/local/lib/perl/5.8.4 -Dman1dir=/usr/share/man/man1 -
Dman3dir=/usr/share/man/man3 -Dsiteman1dir=/usr/local/man/man1 -
Dsiteman3dir=/usr/local/man/man3 -Dman1ext=1 -Dman3ext=3perl -
Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Uusesfio -Uusenm -
Duseshrplib -Dlibperl=libperl.so.5.8.4 -Dd_dosuid -des'
hint=recommended, useposix=true, d_sigaction=define
usethreads=define use5005threads=undef useithreads=define
usemultiplicity=define
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -
DDEBIAN -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -
D_FILE_OFFSET_BITS=64',
optimize='-O2',
cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN -
fno-strict-aliasing -I/usr/local/include'
ccversion='', gccversion='3.3.5 (Debian 1:3.3.5-13)',
gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries:
ld='cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lgdbm -lgdbm_compat -ldb -ldl -lm -lpthread -lc -lcrypt
perllibs=-ldl -lm -lpthread -lc -lcrypt
libc=/lib/libc-2.3.2.so, so=so, useshrplib=true,
libperl=libperl.so.5.8.4
gnulibc_version='2.3.2'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'
Characteristics of this binary (from libperl):
Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES
PERL_IMPLICIT_CONTEXT
Built under linux
Compiled at May 10 2006 03:55:26
@INC:
/etc/perl
/usr/local/lib/perl/5.8.4
/usr/local/share/perl/5.8.4
/usr/lib/perl5
/usr/share/perl5
/usr/lib/perl/5.8
/usr/share/perl/5.8
/usr/local/lib/site_perl
.
lgoddard@uk-sandbox:~/trafficjam/trunk/t$
__TESTS__
cpan[2]> test DateTime::Format::MySQL
Running test for module 'DateTime::Format::MySQL'
Running make for D/DR/DROLSKY/DateTime-Format-MySQL-0.04.tar.gz
CPAN: LWP::UserAgent loaded ok (v2.033)
CPAN: Time::HiRes loaded ok (v1.59)
Fetching with LWP:
ftp://ftp.demon.co.uk/pub/CPAN/authors/id/D/DR/DROLSKY/DateTime-
Format-MySQL-0.04.tar.gz
CPAN: YAML loaded ok (v0.62)
CPAN: Digest::SHA loaded ok (v5.44)
CPAN: Compress::Zlib loaded ok (v1.41)
Checksum for /root/.cpan/sources/authors/id/D/DR/DROLSKY/DateTime-
Format-MySQL-0.04.tar.gz ok
Scanning cache /root/.cpan/build for sizes
........................................................................
....DONE
DateTime-Format-MySQL-0.04/
DateTime-Format-MySQL-0.04/META.yml
DateTime-Format-MySQL-0.04/t/
DateTime-Format-MySQL-0.04/t/01format.t
DateTime-Format-MySQL-0.04/t/02parse.t
DateTime-Format-MySQL-0.04/t/00load.t
DateTime-Format-MySQL-0.04/Changes
DateTime-Format-MySQL-0.04/lib/
DateTime-Format-MySQL-0.04/lib/DateTime/
DateTime-Format-MySQL-0.04/lib/DateTime/Format/
DateTime-Format-MySQL-0.04/lib/DateTime/Format/MySQL.pm
DateTime-Format-MySQL-0.04/MANIFEST
DateTime-Format-MySQL-0.04/Build.PL
DateTime-Format-MySQL-0.04/LICENSE
DateTime-Format-MySQL-0.04/Makefile.PL
DateTime-Format-MySQL-0.04/README
DateTime-Format-MySQL-0.04/SIGNATURE
CPAN: File::Temp loaded ok (v0.18)
CPAN: Module::Build loaded ok (v0.2808)
CPAN.pm: Going to build D/DR/DROLSKY/DateTime-Format-MySQL-0.04.tar.gz
# running Build.PL installdirs=site
/usr/bin/perl Build.PL installdirs=site
Checking whether your kit is complete...
Looks good
Checking prerequisites...
Looks good
Creating new 'Build' script for 'DateTime-Format-MySQL' version '0.04'
/usr/bin/perl Build --makefile_env_macros 1
Copying lib/DateTime/Format/MySQL.pm ->
blib/lib/DateTime/Format/MySQL.pm
Manifying blib/lib/DateTime/Format/MySQL.pm ->
blib/libdoc/DateTime::Format::MySQL.3pm
DROLSKY/DateTime-Format-MySQL-0.04.tar.gz
/usr/bin/make -- OK
Running make test
/usr/bin/perl Build --makefile_env_macros 1 test
t/00load......ok
t/01format....ok
t/02parse.....ok
All tests successful.
Files=3, Tests=46, 1 wallclock secs ( 1.55 cusr + 0.09 csys = 1.64
CPU)
DROLSKY/DateTime-Format-MySQL-0.04.tar.gz
/usr/bin/make test -- OK
cpan[3]>