in reply to Modifying values by reference: what works and what doesn't
but your my $ref = copies the reference, and the copy in $ref is not aliased. This is just like the difference between:sub foo { $_[0] = { all => "new" }; }
which doesn't change the original value in %x andmy %x = (foo => 0, bar => 1); my $z = $x{foo}; $z = 2;
which does.my %x = (foo => 0, bar => 1); $x{foo} = 2;
|
|---|