in reply to Re^3: Assigning value through references
in thread Assigning value through references

The two lookups $ref->{$key} and $ref{$key} access two different variables. They are not interchangeable, and the -> is not optional.

$ref->{$key} looks up the $key key in the $ref hashref.

$ref{$key} looks up the $key key in the %ref hash.