my $xml = XML::Simple->new(ForceArray=>['httpd'], ContentKey=>'-content'); ... my $parsed = ...; foreach {@{$parsed->{httpd}} if (ref($_) eq 'HASH') { #element has attibute(s) #do something with $_->{attr_name} and/or $_->{content} } else { #element has text node only #do something with $_, which is scalar text } }
In reply to Re: HOWTO XML::Simple
by pajout
in thread HOWTO XML::Simple
by pajout
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |