in reply to Re^2: (another) HoH question
in thread (another) HoH question
... isn't $hash-{$key} pointing to %hash? What am I missing?
You're missing the point that the expressions $hash{foo} and $hash->{foo} refer to different and quite separate hashes.
>perl -wMstrict -le "my %hash = ( foo => 'bar' ); my $hash = { foo => 'not_bar_at_all' }; ;; print qq{what is foo? $hash{foo}}; print qq{what is foo? $hash->{foo}}; " what is foo? bar what is foo? not_bar_at_all
|
|---|