Is it possible to determine the type of a variable in TT?

For example, give the following data:

$structure = [ 1, 2, [3, 4], 5, [6], 7];

While iterating over that structure in TT, how could I tell whether each 
item is a scalar or a list?

[% FOREACH item IN structure %]
[% IF ??? %]
It's a scalar!
[% ELSE %]
It's a list!
[% END %]


(What I'm trying to do is create a block to traverse the structure 
recursively.)


thanks,
Ronald

_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to