Le 21 juil. 05 à 07:30, Igor Lobanov a écrit :

Hello

What do you think about usage of locale pragma in 2 TT core distribution modules: Template::Stash and Template::Filters ?

This would allow to use locale-dependent vmethods and filters (sort, upper, match, etc) with non-latin1 locales.

=Patch for Stash.pm

*** Stash.pm.orig       Thu Jul 21 11:04:34 2005
--- Stash.pm    Thu Jul 21 10:50:07 2005
*************** package Template::Stash;
*** 27,32 ****
--- 27,33 ----
 require 5.004;

 use strict;
+ use locale;
use vars qw( $VERSION $DEBUG $ROOT_OPS $SCALAR_OPS $HASH_OPS $LIST_OPS );

 $VERSION = sprintf("%d.%02d", q$Revision: 2.86 $ =~ /(\d+)\.(\d+)/);

=Patch for Filters.pm

*** Filters.pm.orig     Thu Jul 21 11:07:16 2005
--- Filters.pm  Thu Jul 21 10:49:49 2005
*************** package Template::Filters;
*** 27,32 ****
--- 27,33 ----
 require 5.004;

 use strict;
+ use locale;
 use base qw( Template::Base );
 use vars qw( $VERSION $DEBUG $FILTERS $URI_ESCAPES $PLUGIN_FILTER );
 use Template::Constants;


Please don't do this. All locale effects are implicit in Perl. This will
cause a lot of grief. If I may quote Jarkko:

    I can let you in to the ultimate locale secret:

             Avoid.
                -- Jarkko Hietaniemi

--
Eric Cholet



_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to