in reply to Reference/Alias inner hash section
The easy problem first: You've misspelled $update. Of all times, the time use strict; and use warnings; are needed the most is when hunting bugs. Use them!!
$h contains a reference to a scalar, the value at $a{$state}{$city}. You need to deference it before you can do anything with the referenced value.
$a{$state}->{$city}->{Color} = $color; === ${ \( $a{$state}->{$city} ) }->{Color} = $color; # For every reference added, # a dereference must be added. === my $r = \( $a{$state}->{$city} ); ${ $r }->{Color} = $color;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Reference/Alias inner hash section
by mpettis (Beadle) on Sep 09, 2008 at 00:21 UTC | |
by ikegami (Patriarch) on Sep 09, 2008 at 00:28 UTC | |
by mpettis (Beadle) on Sep 09, 2008 at 00:39 UTC |