Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: If I have an array of hashes, how can i store one into a variable?

by snowcrash (Friar)
on Apr 17, 2001 at 11:28 UTC ( [id://73066]=note: print w/replies, xml ) Need Help??


in reply to If I have an array of hashes, how can i store one into a variable?

it doesn't work because you don't have an array of hashes, but an array of references to hashes. arrays can only contain scalar values in perl.
to get the hash the first element of the array refers to, use my %hash1 = %{ $hashes[0] };
checkout perldata, perlref, perllol etc.

cheers
snowcrash //////
  • Comment on Re: If I have an array of hashes, how can i store one into a variable?
  • Download Code

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2024-04-19 21:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found