From teh above response i want to store the content of "thetext" in an array.
<thetext> is the child tag of <long_desc>
If you see the above code there are 2 <long_desc> tags, each has its own child <thetext>.
I need to parse the xml file, and store it in an array
something like I can retrieve them using something like my $root = XMLin($xmlcontent, ForceArray=>1,KeyAttr => {}); //prints he is better } but the above code works because i hardcoded values i.e In real time i need to know how can i find total number of tags. I need to do this whole thing using XML-Simple module of PERL [1][edited by: PankajBansal at 6:35 am (utc) on June 12, 2009]
$myArray[0]= iam great
$myArray= He is better
// $xmlcontent has the response. Whole string i.e
foreach my $bug(@{$root->{bug}})
{
print $root->{bug}->[0]->{long_desc}->[0]->{thetext}->[0];
// prints iam great
print $root->{bug}->[0]->{long_desc}->[1]->{thetext}->[0];
i knew there were 2 long_desc tags. (i.e i usedlong_Desc->[0], long_desc[1] etc)