[Templates] "in array" function?

Andrew Marold drew at marold.org
Wed Mar 5 20:40:45 GMT 2008


How about [% IF foo.match('(foo|bar)') %] ?

	Drew

Chris Petersen wrote:
> I realize that it's somewhat un-perl, but is there a way to do "in"  
> within TT?  It would be nice to keep things clean when I have large  
> lists of things I'm comparing a single variable to in an if-statement.
> 
> [% IF var == 'foo' || var == 'bar' %]
> ...

-- 
Drew Marold - Drew at marold.org
Perl programmer, bass player, luthier, Gentleman Adventurer
Photography: http://www.flickr.com/photos/unstoppabledrew/

Nothing looks worse on your outdoors resume than a list of the possible
locations of your remains.




More information about the templates mailing list