【发布时间】:2017-11-10 21:24:56
【问题描述】:
所以我获取了一个 json 格式输出的 curl 输出并将其分配给一个变量。
my $catcherJSON = decode_json $response->content;
print Dumper $catcherJSON;
当我查看 $catcherJSON 时,我想查看一个哈希数组,但我只得到了一大串 json。
$VAR1 = [
{
'priority' => 5,
'ingestPath' => '/vg/24CHVOD_en',
...
...
...
},
{
'priority' => 5,
'ingestPath' =>
...
...
},
{
'priority' => 5,
'ingestPath' =>
...
...
},
{
'priority' => 5,
'ingestPath' =>
...
...},
{
'priority' => 5,
'ingestPath' =>
....
...
}
];
哈希重复(大约有 300 个唯一结果),我试图在 perl 中弄清楚如何将这 1 个字符串简单地拆分为我的哈希数组。
有什么方法可以轻松地将其转换为适当的哈希数组,以便我可以遍历它?
提前致谢。
【问题讨论】: