The problem is this piece of code:
sub two{ $_[0]->{HASH} = {1 => 'one'}; }
It doesn't modify the hash that $_[0]{HASH} points to, but rather stores a new reference in there. Modifying the existing hash works:
sub two{ $_[0]->{HASH}{1} = 'one'; }
In reply to Re: Changing a returned hashref
by moritz
in thread Changing a returned hashref
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |