You misunderstand my solution Bruce. If you set the options as I described, you will have a hash element that looks like

  'phone2' => undef

instead of the awkward

  'phone2' => {}

This would be my preference instead of suppressing the empty element altogether, which leaves no indication at all that the element was present.

Another reason not to use XML::Simple ;)

HTH,

Rob


Bruce Ferrell wrote:
Thanks Rob,

I'm glad you validated the solution I found.  I figured out that if the
empty tag was suppressed, I could test for the tag being present or not.

Bruce


On 01/30/2010 04:16 AM, Rob Dixon wrote:
Hello Bruce

Take a closer look at the docs, and try

  my $xml = XMLin($data, SuppressEmpty => undef);

HTH,

Rob


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to