title: Simple JSON parsing using Perl
body: <p>I'm trying to parse the Facebook <a href="http://en.wikipedia.org/wiki/Facebook_Platform#Graph_API" rel="noreferrer">Graph API</a> JSON results, and I'm having a bit of trouble with it.</p>
  
  <p>What I was hoping to do was print the number of shares:</p>
  
  <pre><code>my $trendsurl = "https://graph.facebook.com/?ids=http://www.filestube.com";
  my $json;
  {
    local $/; #enable slurp
    open my $fh, "&lt;", $trendsurl;
    $json = &lt;$fh&gt;;
  }
  
  my $decoded_json = @{decode_json{shares}};
  print $decoded_json;
  </code></pre>