使用PERL将值添加到JSON中

时间:2017-06-24 23:23:27

标签: json perl parsing

我用PERL创建我的json:

Apple

结果如下:

$perl_data{form . $num}{filed1} = {name_field => $name, type => $type, length => $max};

如果我想在以后{ "form1" : { "codifica" : "multipart/form-data", "filed0" : { "name_field" : "nome", "type" : "TEXT", "length" : "" }, "action" : "nulla.php", "filed1" : { "name_field" : "cognome", "valore" : "mamma", "type" : "TEXT", "length" : "100" }, "metodo" : "GET" } } 向JSON添加更多数据,我该怎么做?

例如:

$perl_data{form . $num}{filed1}

感谢的!

1 个答案:

答案 0 :(得分:4)

$perl_data{"form$num"}{filed1}{key} = $value;