in reply to Foreach hash of array

For what its worth, this works:
sub printit { my $ref = shift; foreach my $key (keys %$ref) { print "$key: "; if (ref $ref->{$key} eq 'ARRAY') { if (ref $ref->{$key}[0]) { printit($ref->{$key}[0]) } else { print "$ref->{$key}[0]\n" } } elsif (ref $ref->{$key} eq 'HASH') { printit ($ref->{$key}) } else { print "$ref->{$key}\n" } } } printit ($xml);
But I don't know if it gives what you want, 'cause I don't know what you want.