in reply to Parsing XML

Hello, better you forget XML::Simple, may be you'll instead find useful XML::Twig
In the TIMTOWTDI spirit i present a simple XML::Twig solution:

#!/usr/bin/perl use strict; use warnings; use XML::Twig; my $twig=XML::Twig->new( pretty_print => 'indented', twig_handlers => { 'GfmDocument/GfmHeader/TopicMessageID ' => s +ub{print $_[1]->text,"\n";}, '/GfmDocument/GFMIEDM35/OBJ_ITEM_OO_TBL/OBJ_ +ITEM' => sub{ my $twig = shift; my $obj =shift; print map { "\t".$obj->first_ch +ild_text($_)."\n" } qw(OBJ_ITEM_ID CAT_CODE NAME_TXT); my $org = $obj->first_child('OR +G'); print map { "\t".$org->first_ch +ild_text($_)."\n" } qw(ORG_ID CAT_CODE GFM_CAT_CODE); print "\n\n"; }, }, ); $twig->parsefile( 'xmlpmonks.xml') or die; # build it __END__ #output 2754 72060793789255493 OR Oranization 10 72060793789255493 UN NOS 72060793789255508 OR Organization 25 72060793789255508 UN NOS 72060793789255510 OR Organization 50 72060793789255510 UN NOS
hth

L*
There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.