OK, writing a Perl script that will read various XML files, parse that with XML:

imple, and just get the variables.
My code looks like this:
my $xml_input=_getXML($file);
my %data;
$data = $xml->XMLin($xml_input);
# print "Using $file\n";
# print Dumper($data);
foreach my $hash_key (keys %{$data}) {
my $entry = $data->{$hash_key};
parse_entry($entry, $hash_key);
}
sub parse_entry
{
my ($entry, $hash_key) = @_;
if ( ref($entry) eq "HASH") {
print "$hash_key - This is a Hash\n";
foreach my $new_hash_key (keys %{$entry}) {
my $new_entry = $entry->{$new_hash_key};
parse_entry($new_entry, $new_hash_key);
}
print "end hash \n";
} elsif ( ref($entry) eq "ARRAY"){
print "$hash_key - This is an Array\n";
my $i = 0;
foreach my $hash_key (keys %{$entry}) {
my $entry = $data->{$hash_key};
parse_entry($entry, $hash_key);
}
} else {
chomp ($entry);
print "$hash_key - scalar data - $entry\n";
}
}
When I run it with this data (which is matches an ARRAY):
[php]
Parsed:
'para' => [
{
'bold' => 'Some Title'
},
'Some paragraph number 1 ',
'Another Paragraph number two'
]
XML:
Some Title
Some paragraph number 1
Another Paragraph number two
[/php]
But I get Pseudo-hashes are deprecated at ./parse_xml.ipl line 39.
So I assume the Array is part array and part hash. Not certain how to handle that.
Tips/Pointers/RTFMs appreciated.
Andy