Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^3: Add Data to Hash Reference

by moritz (Cardinal)
on Dec 07, 2010 at 20:35 UTC ( [id://875881]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Add Data to Hash Reference
in thread Add Data to Hash Reference

How about

my $test = { 'record' => { 'a' => 11, 'b' => 22 } };

Or just:

my $test; $test->{record}->{'a'} = 11; $test->{record}->{'b'} = 22;

If you want to initialize $test->{record} with something (and don't rely on autovivification), initialize it with {}.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2024-04-16 17:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found