in reply to Re: Sub hash param by reference
in thread Sub hash param by reference
Thank you Marshall, my $ref = \$hash{id2} is exactly what I am trying to look for.
Your given example is perfect. I'm just curious, when calling sub modify_anon_hash_value ($ref) is it possible to do it like modify_anon_hash_value (\$hash{id2}) ? without need to do my $ref = \$hash{id2}.
I have test run it with
The result return correctly without any error. Just to confirm if this way of coding is allowed or it may be a bad way to do it.modify_anon_hash_value (\$hash{id2});
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Sub hash param by reference
by Marshall (Canon) on Jul 08, 2016 at 07:06 UTC | |
by hankcoder (Scribe) on Jul 08, 2016 at 13:05 UTC |