Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > contrib > by-pkgid > b0943b3250f3bc774afd8714ed359b6b > files > 8

perl-XML-EasyOBJ-1.0-3mdk.i586.rpm

use XML::EasyOBJ;

my $doc = new XML::EasyOBJ('rax02test.xml') || die;

# grab the SECOND "record" element (index starts at 0)
my $record = $doc->record(1);

# grab the FIRST "rec2" element within $record
my $rec2 = $record->rec2(0);

# grab the "field2" element from $rec2
# NOTE: If you don't specify an index, the first is returned
#       and in this case there is only 1.
my $field2 = $rec2->field2;

# print the text
print $field2->getString;


exit;