Just another Perl shrine | |
PerlMonks |
Re: How to test all TT2 tags are escaped.by Rhandom (Curate) |
on Oct 28, 2013 at 14:21 UTC ( [id://1059988]=note: print w/replies, xml ) | Need Help?? |
I thought we had got AUTO_FILTER into Template::Toolkit. Oh - no, it was that somebody else wrote a module doing just that. A number of years ago on Perlmonks somebody else (not me) asked for the same thing, and then created Template::AutoFilter. I am the author of Template::Alloy (a near drop in for Template::Toolkit) and also added a native configuration item to Template::Alloy called AUTO_FILTER at about this same time. It is pretty easy to use in Alloy, so I assume that it would be easy to use in Template::AutoFilter as well.
This excerpt comes from the Template::Alloy pod http://search.cpan.org/~rhandom/Template-Alloy-1.020/lib/Template/Alloy.pod. Update: I realized that this is one solution, but it is not a direct answer to the ops question. See my next reply for the real answer to the ops question.
my @a=qw(random brilliant braindead); print $a[rand(@a)];
In Section
Seekers of Perl Wisdom
|
|