That's not how to dereference a hash ref. You're trying to deref it as a scalar, which it isn't, and that's why it's throwing the error.
I was wrong... $$href{try} does actually work. My bad :) I can't figure out why you're receiving that error with the code you've supplied though. Can you post more context?
Dereference individual items with the -> deref operator:
# hashref $h_ref->{try}; # arrayref $aref->[0]; # scalar $$scalar_ref;
...and to dereference entire structures:
# hash my %hash = %$hash_ref; # array my @array = @$aref;
If you need to dereference an entire list-type reference out of a nested structure, you need to use the circumfix operator:
# hash my %hash = %{ $hash_ref->{inner_href} }; # array my @array = @{ $aref->[0] };
A bit more complicated... extract one list-type variable out of a different list-type variable:
# array from href my @array = @{ $href->{inner_array} }; # hash from array ref my %hash = %{ $array->[0] };
In reply to Re: PTKDB - exception catched Not a SCALAR reference
by stevieb
in thread PTKDB - exception catched Not a SCALAR reference
by pjkang7
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |