e.g. (Mason code):
16 % # convert our @cti data structure into a javascript one
17 var cti = [
18 % foreach my $cti_category (@cti) {
19 {
20 label: "<% $cti_category->{'label'} %>",
21 value: "<% $cti_category->{'value'} %>",
22 children: [
23 % foreach my $cti_type (@{$cti_category->{'children'}}) {
24 {
25 label: "<% $cti_type->{'label'} %>",
26 value: "<% $cti_type->{'value'} %>",
27 },
28 % }
29 ]
30 },
31 % }
32 ];