Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Map multiple xml tags to array

by scorpio17 (Canon)
on Aug 14, 2014 at 13:46 UTC ( [id://1097425]=note: print w/replies, xml ) Need Help??


in reply to Map multiple xml tags to array

I think this line is your problem:

my @players_list = \$players;

If $players is a hashref, and you want to build an array of hashrefs, you should do something like this:

push(@players_list, $players);

If you want to convert a hashref into an array, you would do something like this:

@players_list = @{ %$players };

Note that the hash "names" will be at indexes 0,2,4,6... and the hash "values" will be indexes 1,3,5,7...

I hope that helps!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1097425]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (8)
As of 2024-04-23 09:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found