C_T has asked for the wisdom of the Perl Monks concerning the following question:
$hash_ref = modifyHash(\%my_hash); %my_hash = %{$hash_ref}; # hash is now modified sub modifyHash() { my $hash_ref = shift; my %sub_hash = %{$hash_ref}; # Do something to the hash $sub_hash{'test'}=1; return (\%sub_hash); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Modifying a hash in a subroutine?
by ikegami (Patriarch) on Aug 19, 2004 at 21:18 UTC | |
by C_T (Scribe) on Aug 20, 2004 at 16:02 UTC | |
|
Re: Modifying a hash in a subroutine?
by mirod (Canon) on Aug 19, 2004 at 21:17 UTC |