0
我有一个数据结构,如下面的外部文本文件所示。它更大,但格式保持不变。我如何使用这个文件来创建我可以使用的perl数据结构。我在想我可以做一个文件复制并替换所有:with =>。但接下来使用这个外部代码是一个变量。从文件导入gns3数据结构到变量
仿佛是提前
该文件的格式
感谢
{
"auto_close" => "true",
"topology" => {
"drawings" => [],
"links" => [
{
"link_id" => "2c1a64c9-a96e-4c94-ac3d-bbaeadde3773",
"nodes" => [
{
"adapter_number" => 2,
"label" => {
"rotation" => 0,
"style" => "font-family =>",
},
"node_id" => "0807cfc6-ffc9-4762-ad11-d021e2e49b0e",
},
{
"adapter_number" => 0,
"label" => {
"rotation" => 0,
"style" => "fill-opacity => 1.0;",
},
"node_id" => "aeab6b0b-6fd3-43d8-a547-7cd2752dc800",
"port_number" => 0
}
]
}
],
"nodes" => [
{
"compute_id" => "local",
"label" => {
"rotation" => 0,
"style" => "font-family => TypeWriter;",
"text" => "East1",
},
"name" => "East1",
"properties" => {
"auto_delete_disks" => "true",
"platform" => "c7200",
"power_supplies" => [
1,
1
],
"sensors" => [
22
],
},
"symbol" => " =>/symbols/router.svg",
"z" => 1
},
]
},
"type" => "topology",
"version" => "2.0.3"
};
会EVAL工作呢? – hoffmeister