使用 Perl,我从 API 调用中获得了一个基于字典的字典key
。value
use strict;
use warnings;
use LWP::Simple;
my $url = "http://example.com/?id=124341";
my $content = get($url);
$content =~ s/ /%20/g;
print $content;
{"id":"85710","name":"jack","friends":["james","sam","Michael","charlie"]}
我如何解析它以获得如下结果?
name : jack
hist friend list :
james
sam
Michael
charlie
谢谢!