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 {}.
In reply to Re^3: Add Data to Hash Reference
by moritz
in thread Add Data to Hash Reference
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |