in reply to XML::Simple Multi Level Array

I've attached a few screen shots in that it will be easier to see the data structure.
I'm not sure what you meant by that, but it doesn't appear to have worked.

Also, what exactly are you having difficulty with? How do I post a question effectively?

Replies are listed 'Best First'.
Re^2: XML::Simple Multi Level Array
by drodinthe559 (Monk) on Feb 11, 2010 at 16:37 UTC
    How do I loop through the hash in the {Batch} index? You'll notice I have a zero.
      # This looks wrong, but it's what you gave us my $batches = $data->{Jobs}{Job}{Blocks}{Block}{Batches}{Batch}; for my $batch (@$batches) { # This looks also wrong my $item = $batch->{Items}{Item}; print $item->{CorporateName} . "\n"; print $item->{Amount} . "\n"; }
      I would have expected something more like
      my $jobs =$data->{Jobs}{Job}; for my $job (@$jobs) { my $blocks = $job->{Blocks}{Block}; for my $block (@$blocks) { my $batches = $job->{Batches}{Batch}; for my $batch (@$batches) { my $items = $batch->{Items}{Item}; for my $item (@$items) { print $item->{CorporateName} . "\n"; print $item->{Amount} . "\n"; } } } }

      By the way , the following would simplify your tree:

      GroupTags => { Jobs => 'Job', Blocks => 'Block', Batches => 'Batch', },