parsing json with perl
I have a url which should be invoked from my perl 开发者_StackOverflow社区script with a specific parameter. On invoking the url it returns me a JSON. I will have to parse this JSON in the same script. What is the best way to get this done in perl. A pseudo code would be of help :)
You can try something like this:
use LWP::Simple qw(get);
use JSON qw(from_json);
my $url = "http://example.com/get/json";
my $decoded = from_json(get($url));
See docs for LWP::Simple and JSON for more details.
精彩评论