title: How to convert perl hash to javascript hash
body: <p>I am working in <a href="http://www.template-toolkit.org" rel="nofollow">template toolkit</a> framework. I have got an perl hash datatype in my tt file. I want to convert this hash datatype to javascript hash datatype.</p>
  
  <p>code:
  template:</p>
  
  <pre><code>        [% PERL %]
          use JSON qw(encode_json);
  
          my $vars = {
  
              'version'  =&gt; 3.14,
              'days'     =&gt; [ qw( mon tue wed thu fri sat sun ) ],
              'cgi'      =&gt; CGI-&gt;new(),
              'me'       =&gt; {
                  'id'     =&gt; 'abw',
                  'name'   =&gt; 'Andy Wardley',
              },
          };
  
          my $json = encode_json($vars-&gt;{'me'});
      [% END %]
  
  
   &lt;script&gt;
     function callme(){
     var me = [% $json %]
    }
  &lt;/script&gt;
  </code></pre>
  
  <p>now i want the me hash to be accessible in javascript</p>