in reply to Nested data with XML::Simple

How do you read the file?

Replies are listed 'Best First'.
Re^2: Nested data with XML::Simple
by cyrilw (Initiate) on Feb 22, 2013 at 01:33 UTC

    Is this the bit you wanted.?

    my ( $xmlFile ) = $ARGV[0]; my ( $xs1 ) = XML::Simple->new(); my ( $message ) = $xs1->XMLin( $xmlFile, KeyAttr => [], ForceArray => +[ 'StructuredNote', 'ItemDetail', 'ItemDetail->StructuredNote' ] );

      Yes, but not really

      If you use that, then  my ( $orderDetail ) = $message->{OrderDetail}; is undef, so no loops will ever get entered

      But you say the loop does get entered, so I offer you How do I post a question effectively? , because typos and pseudocode don't work as debugging methods

      Cyril, your code won't run as you have presented it - try it yourself. Correct it and then re-post.