(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"; } }
In reply to Re: References on hashes!
by graff
in thread References on hashes!
by Ace128
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |