[Templates] keys.sort.grep.join

Anthony Gardner cyclewood_ltd at yahoo.co.uk
Wed Nov 21 09:56:02 GMT 2007


Am trying to get some Perl code into a template (to do with presentation ;) ) 

How can I do the following in TT without using a FOREACH? Just pointing me to the right place in the docs would be great. Sadly, TT doesn't have map (or at least I can't find it in vmethods etc.)

Perl
$result = join( ',',  map{ $my_hash->{A_KEY}->{$_} }
                               grep{ ! /some_string/ }
                               sort keys %{$my_hash->{A_KEY}}
                         );

TIA

-Ants





Disclaimer: Technically, I'm always wrong!!
       
---------------------------------
 Yahoo! Answers - Get better answers from someone who knows. Tryit now.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.template-toolkit.org/pipermail/templates/attachments/20071121/59d46b01/attachment.htm 


More information about the templates mailing list