drodinthe559 has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict; use warnings; use File::Glob; use XML::Simple; use Data::Dumper; my @files = glob("//Server/Share/*.xml"); my $xml = XML::Simple->new(KeyAttr=>[]); #, ForceArray=>1); foreach my $x (@files) { my $data = $xml->XMLin($x); foreach my $key (@{$data->{Jobs}->{Job}->{Blocks}->{Block}->{Batch +es}->{Batch}->[0]->{Items}->{Item}}) { print $key->{CorporateName} . "\n"; print $key->{Amount} . "\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XML::Simple Multi Level Array
by GrandFather (Saint) on Feb 11, 2010 at 04:59 UTC | |
|
Re: XML::Simple Multi Level Array
by desemondo (Hermit) on Feb 11, 2010 at 02:06 UTC | |
by drodinthe559 (Monk) on Feb 11, 2010 at 16:37 UTC | |
by ikegami (Patriarch) on Feb 11, 2010 at 16:57 UTC |