in reply to References on hashes!
(note the double sigils on the hash ref: %$a_ref2 refers to the entire hash, and $$a_ref2{$_} refers to a single hash element; another way to do the latter is $a_ref2->{$_})sub add { my $a_ref2 = shift; $$a_ref2{modified}++; # (update: I forgot to include this step) foreach (keys %$a_ref2) { print $_ . " " . $$a_ref2{$_} . "\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: References on hashes!
by Ace128 (Hermit) on Jul 08, 2005 at 23:24 UTC | |
by graff (Chancellor) on Jul 10, 2005 at 01:34 UTC | |
|
Re^2: References on hashes!
by Ace128 (Hermit) on Jul 08, 2005 at 22:40 UTC |