开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜