I am using XML::Simple and I have the following XML structure in a variable $xmldata which I need to access through Perl code.
<root>
<a>sfghs</a>
<b>agaga</b>
<c>
<c1>sgsfs</c1>
<c2>sgsrsh</c2>
</c>
<d>
<d1>agaga</d1>
<d2>asgsg</d2>
</d>
</root>
I can access the value of a and b by using the following code :
$aval = $xmldata->{a}[0];
$bval = $xmldata->{b}[0] ;
Now, my question is: how can I get the value of say, d2 ?