zelizelizelizeli
Technical User
I am trying to get the value in between to tags:
I am trying to get whats inside <me> </me> which is the 34343434 but cannot.
xml.xml
-------
<main>
<new>
<me nam="ge">34343434</me>
</new>
</main>
xml.pl
------
#!/usr/bin/perl
use XML::Simple;
use Data:umper;
$xml = new XML::Simple;
$data = $xml->XMLin("result2.xml");
$name=$data->{new}->{me}->{nam};
$id=$data->{new}->{me};
print "This is the nam=$name\n";
print "$id\n";
I cannot get $id.
Can anyone help.
I am trying to get whats inside <me> </me> which is the 34343434 but cannot.
xml.xml
-------
<main>
<new>
<me nam="ge">34343434</me>
</new>
</main>
xml.pl
------
#!/usr/bin/perl
use XML::Simple;
use Data:umper;
$xml = new XML::Simple;
$data = $xml->XMLin("result2.xml");
$name=$data->{new}->{me}->{nam};
$id=$data->{new}->{me};
print "This is the nam=$name\n";
print "$id\n";
I cannot get $id.
Can anyone help.