Im using HTML::Template to display data from database in a tree form. The data is being passed an arrayref of hashref, to the template. The data looks something like this;
[
{
'name' => 'foo',
'id' => 1
'children' => [
{
'name' => 'bar',
'id' => 2,
"children" => ...
},
....
]
},
...
]
I use a <tmpl_loop> construct to display the "name" and "id" in the tree.
However for some of the branches the "children" key might be present or not. Also the "children" is recursive, as in a sub-branch can have sub-sub-branch and so on.
I have problem in using HTML::Template to display this data structure, as the data is recursive. Is there a way to use HTML::Template to display such data structures ?