$VAR1 = {
'name' => 'Constants',
'attribute' => [
{
'identifier' => '00',
'required' => ' true ',
'name' => ' session_id ',
'type' => ' string ',
'ilog' => {
'visible' => ' false ',
'alternate' => ' session id in st
+ring format '
}
},
{
'identifier' => '01',
'required' => ' false ',
'type' => ' int ',
'name' => ' volume ',
'ilog' => {
'alternate' => ' the volume ',
'visible' => ' false '
}
}
],
'properties' => {
'visible' => ' false '
},
'serviceKey' => '0',
'version' => '0',
'ui-visible' => '0',
'id' => '0',
'rateTableName' => ''
};
In your program, $Event is a hash reference. The data you want is under the attribute key. So you'd start with $Event->{attribute}. That is an array ref. Each element of that array is ANOTHER hash ref. 'name' and 'required' are keys in that hash.
What I usually do in this situation is run the program in the debugger. Then I can incrementally build the expression that gets to the data I need.
If you're thinking 'wow, this is alot of work', well yeah it is. That's why you should invest the time to learn a real XML module instead of XML::Simple.
|