Hi All, Got the solution .. [% FOREACH key IN hash.keys %] [% key %] [% ":" %][% hash.$key.0 %][% hash.$key.1 %] [% END %]
Regards, Rajesh On Tue, Apr 10, 2012 at 11:56 AM, Rajesh Saha <rajeshsaha...@gmail.com>wrote: > Hi > > *I have a perl script like this:* > > #!/usr/bin/perl > use Template ; > $tt = Template->new(); > $file = "test.tt" ; > %hash = ( > 'a' => [1,2], > 'b' => [3,4], > ) ; > $vars = { > hash => \%hash > } ; > $tt->process($file,$vars) ; > > > *The template file (test.tt) is like this :* > > [% FOREACH key IN hash.keys %] > [% key %] [% ":" %][% key.0 %][% key.1 %] > [% END %] > > *My intension is to get an output like this :* > > a : 1 2 > b : 3 4 > > But, I not getting. Actually, I don't know how to handle the reference in > template . Can anybody please help ? > > > Thanks n regards > Rajesh Saha > >
_______________________________________________ templates mailing list templates@template-toolkit.org http://mail.template-toolkit.org/mailman/listinfo/templates