title: Parsing an array encoded in JSON through perl
body: <p>I am using the Following Perl code to parse an array in JSON, using the <a href="https://metacpan.org/pod/JSON" rel="noreferrer"><code>JSON</code> module</a>. But the array returned has length 1 and I am not able to iterate over it properly. So the problem is I am not able to use the array returned.</p>
  
  <pre><code>#!/usr/bin/perl
  use strict;
  
  my $json_text = '[ {"name" : "abc", "text" : "text1"}, {"name" : "xyz", "text" : "text2"} ]';
  
  use JSON;
  use Data::Dumper::Names;
  
  my @decoded_json = decode_json($json_text);
  print Dumper(@decoded_json), length(@decoded_json), "\n";
  </code></pre>
  
  <p>The output comes :</p>
  
  <pre><code>$VAR1 = [
       {
          'text' =&gt; 'text1',
          'name' =&gt; 'abc'
        },
        {
          'text' =&gt; 'text2',
          'name' =&gt; 'xyz'
        }
      ];
  1
  </code></pre>