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