Subject: | Parse error for french date with 'mars' (march) as month |
Date::Parse.pm $VERSION = "2.27",
#! /usr/bin/perl
use strict ;
use Date::Language ;
my $dateP = Date::Language->new('French');
my $timestamp = $dateP->str2time('4 mars 2005') ;
my ($ss,$mm,$hh,$day,$month,$year,$zone) = localtime $timestamp;
my %elem = ();
$month++;
$year +=1900;
$elem{'Day'} = $day ;
$elem{'Month'} = $month;
$elem{'Year'} = $year;
print " --> $day/$month/$year\n" ;
Threre is a bug while parsing a date in french containing 'mars'
As far as I understand, it's because 'mar' (= mardi = tuesday) is
suppressed in the substitution in
Date::Parse.pm $VERSION = "2.27", line 62 and 90 :
62: my $daypat = join("|", map { lc $_ } reverse sort keys %$day_ref);
89: $dtstr =~ s#($daypat)\s*(den\s)?# #o;
eg. $dtstr = '4 mars 2005' --> $dtstr = '4 s 2005' ;
I temporaly solve that by setting:
89: $dtstr =~ s#($daypat)\b\s*(den\s)?# #o;
but it's probably not the right solution....
Regards,
Jean-Paul
Linux host62 2.4.29 #6 Thu Jan 20 16:30:37 PST 2005 i686 unknown unknown
GNU/Linux
Summary of my perl5 (revision 5 version 8 subversion 6) configuration:
Platform:
osname=linux, osvers=2.4.28, archname=i486-linux
uname='linux midas 2.4.28 #6 tue dec 14 14:41:15 pst 2004 i686
unknown unknown gnulinux '
config_args='-de -Dprefix=/usr -Dcccdlflags=-fPIC
-Dinstallprefix=/usr -Doptimize=-O2 -march=i486 -mcpu=i686
-Dinc_version_list=5.8.5 5.8.4 5.8.3 5.8.2 5.8.1 5.8.0
-Darchname=i486-linux'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef
usemultiplicity=undef
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-fno-strict-aliasing -pipe -I/usr/local/include
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O2 -march=i486 -mcpu=i686',
cppflags='-fno-strict-aliasing -pipe -I/usr/local/include'
ccversion='', gccversion='3.3.4', 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=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc
perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
libc=/lib/libc-2.3.3.so, so=so, useshrplib=false, libperl=libperl.a
gnulibc_version='2.3.3'
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: USE_LARGE_FILES
Built under linux
Compiled at Jan 1 2005 19:33:27
@INC:
/usr/lib/perl5/5.8.6/i486-linux
/usr/lib/perl5/5.8.6
/usr/lib/perl5/site_perl/5.8.6/i486-linux
/usr/lib/perl5/site_perl/5.8.6
/usr/lib/perl5/site_perl