in reply to XML::Simple - storing/retrieving 2 tables into 1 XML file

It seems like your structure is not exactly the way you are expecting it to be. You'll want to use a module like Data::Dumper::Simple to check it out.

This said, just change:

  foreach $e (@{$data->{Phones}})

into:

  foreach (@$data)
  {
          my $e = $_->{Phones};

and the magick occurs ;^)

HTH.

  • Comment on Re: XML::Simple - storing/retrieving 2 tables into 1 XML file