in reply to Add Data to Hash Reference

You need to specifically create hash reference. Here is better code that prints your new hash. Note: Now dumpvar puts out data but also print another hash with undef value. I believe that is due to auto-vivification but I could be wrong.
#!/usr/bin/perl use strict; use warnings; use Data::Dumper; my %test = { record => ' ' }; my $test = \%test; $test->{record}->{'a'} = 11; $test->{record}->{'b'} = 22; print Dumper \%test;

Replies are listed 'Best First'.
Re^2: Add Data to Hash Reference
by Anonymous Monk on Dec 07, 2010 at 21:10 UTC
    This produces:

    Reference found where even-sized list expected at ./875882.pl line 7. $VAR1 = { 'record' => { 'a' => 11, 'b' => 22 }, 'HASH(0x604290)' => undef };
    If you had read the warning, you'd have realized that there's something wrong with the line

    my %test = { record => ' ' };