Where can I find a Perl module for converting a Perl data structure into a JavaScript one?
e.g. this is my code (Mason):
% # convert our @cti data structure into a javascript one
var cti = [
% foreach my $cti_category (@cti) {
{
label: "<% $cti_category->{'label'} %>",
value: "<% $cti_category->{'value'} %>",
children: [
% foreach my $cti_type (@{$cti_category->{'children'}}) {
{
label: "<% $cti_type->{'label'} %>",
value: "<% $cti_type->{'value'} %>",
},
% }
]
},
% }
];
is there a module for this?