use warnings;
use strict;
use CGI qw( header start_html );
use Template;
use Lingua::EN::Numbers::Ordinate 'ordinate';
my %Config =
(
FILTERS => { ordinal => sub { ordinate($_[0]) } }
);
my $tt2 = Template->new(\%Config);
print
header(),
start_html(-title => 'Ordinals');
$tt2->process(\*DATA, { bingo => [ 0 .. 121 ] })
or warn $Template::ERROR;
__DATA__
<h1>Ordinals</h1>
[% FOR i IN bingo %]
[% i | ordinal %]
[% END %]
[close]
Permanent link · http://querylog.com/q/template+toolkit+ordinals