in reply to Map multiple xml tags to array

Howdy, dear anonymous monk,

Can't call method "convert" on an undefined value at 1097409.pl line 1 +0.

could you be so kind and actually post working code that shows the problem you're having? The monks are more than happy to help you, but we'd rather not fix up unrelated issues with your code first.

In the same vein, the XML snippet you posted is not well-formed (the last line should be </Players> instead).

That said, here's some tips for solving your problem: Be sure to read the documentation for XML::Simple and familiarize yourself with the kind of data structures it returns. Use Data::Dumper or a similar module to get an idea of what the data you're getting for YOUR file looks like. And finally, keys is your friend when iterating over hashes.

Replies are listed 'Best First'.
Re^2: Map multiple xml tags to array
by Anonymous Monk on Aug 14, 2014 at 13:09 UTC

    Hi, i don't understand, my working code is exactly as i place here, and i don't get the undefined error.

      in addition to what AppleFritter and GotToBTru noted,
      you report about
      an error saying that Hash cannot be used a array while strict refs are in use.
      The posted code doesn't even have strict in use...

      You declare the variable $iconv, and in the next mention of it, call its convert method, without ever defining that $iconv is any kind of object (Text::Iconv->new).

      1 Peter 4:10