[Templates] Developer Release 2.09c PATCHES

Axel Gerstmair Axel Gerstmair <anthill@web.de>
Wed, 30 Apr 2003 14:24:02 +0200


Hi Andy,

> It should be something more like this:

>  -- expect --
>  -- process --
> -[% nowloc(time, '%A', 'en_GB') %]
> +[% USE date(time='4:20:00 9-13-2000', format='%s');
> +   nowloc(date.format, '%A', 'en_GB') 
> +%]

> The test date always generates 'Tuesday' or the local equivalent,
> given that 13th September 2000 was a Tuesday.  But your expected
> outcome was using the current 'time', so it coincidentally worked 
> yesterday, but had me scratching my head today...  :-)

oh, yes indeed! That's right! I shouldn't just copy and paste from
above -- that's evil :-) But that is why more than one person is
working on it. You should have something to do, too ;-)

Now, I've just tried the new date test but it failed again because
WinXP doesn't know the "%s" format (strftime("%s", ...) returns "%s").
So I worked out a new approach that uses the seconds since the epoch
explicitly and it worked -- for me, today.

 -- expect --
 -- process --
-[% USE date(time='4:20:00 9-13-2000', format='%s');
-   nowloc(date.format, '%A', 'en_GB') 
+[% # 4:20:00 9-13-2000 equals 979010400 seconds since the epoch
+   nowloc(979010400, '%A', 'en_GB')
 %]

Besides, I found out another thing about the bug with the XS stash
option I fixed yesterday. There was only a problem if you ran
Makefile.PL twice. First, enabling the XS stash and using it as the
default, and then in the second run, disabling the XS stash.

Best regards,
Axel