in reply to Adding row in a hash Help!!
This ought to do it. perldsc.
use Data::Dumper; # So that we can inspect our result. # Initial state. my $aref = [ { 'xml_api_reply' => { '-version' => '1', 'weather' => { '-row' => '0', 'current_conditions' => { } }, }, }, ]; # Now add 'report_date' key and its value at the appropriate level. $aref->[0]{'xml_api_reply'}{'weather'}{'report_date'} = { '-data' => ' +08-19-2012 @ 15:40:26' }; # Inspect the result. print Dumper $aref;
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Adding row in a hash Help!!
by Anonymous Monk on Aug 20, 2012 at 02:27 UTC | |
by davido (Cardinal) on Aug 20, 2012 at 03:02 UTC | |
by hbm (Hermit) on Aug 20, 2012 at 02:46 UTC | |
by Anonymous Monk on Aug 20, 2012 at 02:53 UTC | |
by hbm (Hermit) on Aug 20, 2012 at 03:52 UTC | |
by Anonymous Monk on Aug 20, 2012 at 04:03 UTC |