Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Map multiple xml tags to array

by scorpio17 (Canon)
on Aug 14, 2014 at 13:46 UTC ( #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
Node Status?
node history
Node Type: note [id://1097425]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2019-10-15 07:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?