title: How to access an array in Perl passed through Ajax jquery
body: <p>I am calling a Perl script from HTML using jquery ajax, with given array.</p>
  
  <pre><code>var items = [
      { "itemname": "item1", "mrpprice": 1999, "sellprice" : 21.50, "quantity": 2},
      { "itemname": "item2", "mrpprice": 1999, "sellprice" : 22.50, "quantity": 1}
  ];
  
  $.ajax({
      type: "GET",
      contentType: "application/json; charset=utf-8",
      dataType: "json",
      url: "/cgi-bin/submit_order.pl", // URL of the Perl script
      data: { itemsArray : items },
      success: function(data)
      { alert ("success")}
  });
  </code></pre>
  
  <p>and reading the CGI param in perl file like this.</p>
  
  <pre><code>my @values = $cgi-&gt;param('items[]');
  </code></pre>
  
  <p>But not able to access the values in Perl file. I am using the following syntax for accessing.</p>
  
  <pre><code>print $values[0]{'quantity'};
  </code></pre>
  
  <p>Can anyone help in what in wrong in this, and what is the correct way to access. Any help will be appreciated.</p>