Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个返回 json 字符串的 perl 脚本。
$json = `/usr/bin/perl /var/www/private/data.pl`;
data.pl 返回{"key1": "value1", "key2": "value2"}
{"key1": "value1", "key2": "value2"}
访问 $json 变量中的 json 字符串的最佳方法是什么?
所有你需要的是
exec('/usr/bin/perl /var/www/private/data.pl',$jsonArray); $json = reset($jsonArray);