title: Perl array - trying to parse quotes in proper array elements
body: <p>I have been struggling with this for a while in a Perl script I have. Probably a slam dunk for you Perl experts, and probably should be easier, but I can't quite crack the nut on this. I might be needing to split this, not sure.</p>
  
  <p>My array code as is follows.</p>
  
  <pre><code>while ( my $row = $query_handle-&gt;fetchrow_hashref('NAME_lc') ){  
      push @query_output, $row; 
      push (@{portfo-&gt;{label}},$row-&gt;{data},$row-&gt;{label}); 
  }   
  </code></pre>
  
  <p>And then my print of the array is as follows:</p>
  
  <pre><code>    print "array here--";
  print "[";
  foreach (@{portfo-&gt;{label}}) {
      #(@{portfo-&gt;{label}},$row-&gt;{data});
      print "\{\"data\":";
      print "".$_.",";
      print "\"label\":";
      print "\"".$row[1]."\"\},";
  }
  print "]";
  print "\n";
  </code></pre>
  
  <p>And then my output looks like this:</p>
  
  <pre><code>[{"data":2943,"label":""},{"data":CDI3,"label":""}, 
  {"data":1,"label":""},{"data":COS-COS2,"label":""}, 
  {"data":1087,"label":""},{"data":COS1,"label":""},
  {"data":5183,"label":""},{"data":COS2,"label":""},
  {"data":2731,"label":""},{"data":CULB,"label":""},{"data":1,"label":""},
  {"data":EQUIT,"label":""},{"data":4474,"label":""},
  {"data":Network,"label":""},]
  </code></pre>
  
  <p>I am trying to make the apha-num string array items like CDI3, COS1, COS2, etc in quotes, in the label part. Somehow I'm getting it separated. Meanwhile, I do want the numeric values left with the "data" name pair. </p>
  
  <pre><code>[{"data":2943,"label":""},{"data":"CDI3","label":""}, 
  {"data":1,"label":""},{"data":"COS-COS2","label":""}, 
  {"data":1087,"label":""},{"data":"COS1","label":""},
  {"data":5183,"label":""},{"data":"COS2","label":""},
  {"data":2731,"label":""},{"data":"CULB","label":""},{"data":1,"label":""},
  {"data":"EQUIT","label":""},{"data":4474,"label":""},
  {"data":"Network","label":""}]
  </code></pre>
  
  <p>I'm sure it's a simpler fix that I'm making it but so far no luck. Any tips would be greatly appreciated!</p>
  
  <p>Thanks!</p>