Ace128 has asked for the wisdom of the Perl Monks concerning the following question:
And this prints:my %a; my $a_ref = \%a; &resetCounters(); &add($a_ref); print $a{'modified'} . "\n"; print $a{'removed'}; sub resetCounters { $a{'added'} = 0; $a{'removed'} = 7; $a{'modified'}++; print $a{'modified'} . "\n"; } sub add { my $a_ref2 = shift; my %temp = %{$a_ref2}; $temp{'modified'}++; foreach (keys %temp) { print $_ . " " . $temp{$_} . "\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: References on hashes!
by graff (Chancellor) on Jul 08, 2005 at 03:55 UTC | |
by Ace128 (Hermit) on Jul 08, 2005 at 23:24 UTC | |
by graff (Chancellor) on Jul 10, 2005 at 01:34 UTC | |
by Ace128 (Hermit) on Jul 08, 2005 at 22:40 UTC | |
|
Re: References on hashes!
by artist (Parson) on Jul 08, 2005 at 03:45 UTC |