bits wrote:
> Catalyst::Helper::_mk_changes calls POSIX::strftime on line 390:
> my $time = strftime('%Y-%m-%d %T', localtime time);
>
> the %T parameter causes my Activestate Perl 5.8.8 820 to infinite loop.
>
>
> In fact,
> perl -MPOSIX -e "print POSIX::strftime('%T', localtime time);"
> also infinite loops.
>
> Nice.
>
>
> The perldoc for POSIX states in the strftime notes:
> "If you want your code to be portable, your format (fmt ) argument should
> use only the conversion specifiers defined by the ANSI C standard (C89, to
> play safe). These are aAbBcdHIjmMpSUwWxXyYZ% ."
>
> %T is not in the list. On all the systems I have at my disposal, %H:%M:%S
> produces equivalent output and uses only the conversion specifiers they
> recommend.
>
>
> For the sake of saving the next soul who wants to use Catalyst under Win32,
> which apparently doesn't like %T, suggest changing to:
>
> my $time = strftime('%Y-%m-%d %H:%M:%S', localtime time);
>
>
>
> --- Helper.pm Wed Jul 11 03:24:55 2007
> +++ Helper.pm.orig Mon Oct 30 18:00:42 2006
> @@ -387,7 +387,7 @@
> sub _mk_changes {
> my $self = shift;
> my $dir = $self->{dir};
> - my $time = strftime('%Y-%m-%d %H:%M:%S', localtime time);
> + my $time = strftime('%Y-%m-%d %T', localtime time);
> $self->render_file( 'changes', "$dir\/Changes", { time => $time } );
> }
>
Just for the sake of mentioning it...SVK had similiar problems under
win32 with %T and also the zone info....
Here was the final patch:
> sub time2str {
> my ($format, $time) = @_;
> if (IS_WIN32) {
> require Date::Format;
> goto \&Date::Format::time2str;
> }
>
> require POSIX;
> return POSIX::strftime($format, localtime($time) );
> }
Not necessarily the solution, but an illustration of one possible
solution...
signature.asc
Description: OpenPGP digital signature
_______________________________________________ List: [email protected] Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[email protected]/ Dev site: http://dev.catalyst.perl.org/
