in reply to Adding to hash of hashes
but then I want to add an end => 10 to the same anonymous hash without replacing what's already there
OUTPUT:use warnings; use strict; use Data::Dumper; my %hoh; $hoh{element1} = {start => 1, middle => 5}; print Dumper \%hoh; $hoh{element1}{end}=10; # add to hash print Dumper \%hoh;
For more information, please check the following: perldsc, perlref, perllol, perldata, perlobj$VAR1 = { 'element1' => { 'middle' => 5, 'end' => 10, 'start' => 1 } };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Adding to hash of hashes
by AnomalousMonk (Archbishop) on Aug 25, 2012 at 04:45 UTC | |
|
Re^2: Adding to hash of hashes
by Dlamini (Novice) on Aug 25, 2012 at 02:55 UTC |