我是 perl 新手,我想获取使用这样的XML::SIMPLE
模块生成的哈希表的键
$data = $xml->XMLin("tp.xml");
这是生成的结构
$VAR1 = {
'technical-profile' => {
'WEB' => {
'mandatory-param' => {
'value' => 'high',
'name' => 'screenCapability',
'case-sensitive' => 'no'
}
},
'WAP/PDA' => {
'description' => 'wap/sparphone',
'mandatory-param' => {
'value' => 'low|intermediate',
'name' => 'screenCapability',
'case-sensitive' => 'no'
}
},
'WAP' => {
'description' => 'wap/sparphone',
'mandatory-param' => {
'value' => 'low',
'name' => 'screenCapability',
'case-sensitive' => 'no'
}
}
}
};
我试过这个
print "Key: $_" foreach (keys%data);
但我什么也得不到;我想打印WEB
WAP/PDA
,WAP
请问这怎么可能?