in reply to assigning value of a key in a hash to a variable while dereferencing

Remember that leading sigils change when you access a single value.

Dereference the hashref $foo: %{$foo} or %$foo

Dereference the hashref $foo and return a single value: ${$foo}{$key} or $$foo{$key} or $foo->{$key}

  • Comment on Re: assigning value of a key in a hash to a variable while dereferencing