in reply to Modifying a hash in a subroutine?
It looks like you are doing a lot of ref to hash and hash to ref transformations. This might be simpler:
modifyHash(\%my_hash); sub modifyHash { my $hash_ref = shift; # Do something to the hash $hash_ref->{'test'}=1; # no need for return, the original hash has been modified # the return value could be a success/failure flag }
|
|---|