From: Dirk Koopman Date: Mon, 15 Oct 2007 11:25:57 +0000 (+0100) Subject: fix regex in sh/contest for perl < 5.8.x X-Git-Tag: 1.55~41^2~3 X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?p=spider.git;a=commitdiff_plain;h=715cd45b038dab6a7fefd8249e1268b25982eeed fix regex in sh/contest for perl < 5.8.x --- diff --git a/Changes b/Changes index 828c4284..90eef374 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,6 @@ +15Oct07======================================================================= +1. prevent PC61 from propagating outside spider boxes. +2. simplify the regex for sh/contest to allow it to work on perl < 5.8.x. 09Oct07======================================================================= 1. Added *VERY* important change to prevent loops on PC9x sentences. 06Oct07======================================================================= diff --git a/cmd/show/contest.pl b/cmd/show/contest.pl index 08f555ee..43c0bc39 100644 --- a/cmd/show/contest.pl +++ b/cmd/show/contest.pl @@ -18,8 +18,8 @@ my $mon;; # trying to make the syntax abit more user friendly... # and yes, I have been here and it *is* all my fault (dirk) $line = lc $line; -my ($m,$y) = $line =~ /^([a-z]{3})\w*\s*(\d+)/; -($y,$m) = $line =~ /^(\d+)\s*([a-z]{3})/ unless $y && $m; +my ($m,$y) = $line =~ /^([a-z]+)\s*(\d+)/; +($y,$m) = $line =~ /^(\d+)\s*([a-z]+)/ unless $y && $m; unless ($y && $m) { ($m,$y) = (gmtime)[4,5]; $m = qw(jan feb mar apr may jun jul aug sep oct nov dec)[$m]; @@ -27,6 +27,7 @@ unless ($y && $m) { } $y += 2000 if $y <= 50; $y += 1900 if $y > 50 && $y <= 99; +$m = substr $m, 0, 3 if length $m > 3; $m = 'oct' if $m eq 'okt'; $m = 'may' if $m eq 'mai' || $m eq 'maj'; $mon = "$y$m"; diff --git a/perl/Version.pm b/perl/Version.pm index 7fa6af04..aa169b26 100644 --- a/perl/Version.pm +++ b/perl/Version.pm @@ -11,6 +11,6 @@ use vars qw($version $subversion $build); $version = '1.54'; $subversion = '0'; -$build = '173'; +$build = '174'; 1;