Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Accessing and printing an array, INSIDE of a hash

by Corion (Pope)
on Sep 25, 2011 at 14:36 UTC ( #927751=note: print w/ replies, xml ) Need Help??


in reply to Accessing and printing an array, INSIDE of a hash

This line:

$hash{'key'} = @array;

... does not do what you think it does. Hashes can only take scalar values, not arrays. You can store a reference to the array:

$hash{'key'} = \@array;

... and then retrieve it back. See Data::Dumper for inspecting your data structures, References Quick Reference on how to get at the data.


Comment on Re: Accessing and printing an array, INSIDE of a hash
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (18)
As of 2015-07-31 21:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (282 votes), past polls