in reply to Re^3: Adding row in a hash Help!!
in thread Adding row in a hash Help!!

It runs, but look at the extra line added to end end of the file:
... $VAR1->[1] = $VAR1->[0]{'xml_api_reply'}{'weather'}{'report_date'};

Replies are listed 'Best First'.
Re^5: Adding row in a hash Help!!
by hbm (Hermit) on Aug 20, 2012 at 03:52 UTC

    Ah, ok. Try these changes:

    # no need for this loop: # for my $w_data (@$weather_data) { # push @data, $w_data; # } # Now add 'report_date' key and its value at the appropriate level. #push @data, $weather_data->[0]{'xml_api_reply'}{'weather'}{'report_da +te'} = { '-data' => $today #}; push @{$weather_data->[0]{'xml_api_reply'}{'weather'}{'report_date'}}, + { '-data' => $today }; # print Dumper(\@data); print Dumper(\$weather_data);