in reply to PTKDB - exception catched Not a SCALAR reference

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] };

Replies are listed 'Best First'.
Re^2: PTKDB - exception catched Not a SCALAR reference
by choroba (Cardinal) on Nov 24, 2015 at 17:28 UTC
    That's not true. Have you tried running the OP code? The "ugly" syntax is possible, too:
    $$href{try}

    is the same as

    $href->{try}

    You can even write

    ${$href}{try}
    ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

      No, I didn't unfortunately, but did after I posted my reply (sigh). I was far too quick to assume. Normally I don't do that.

Re^2: PTKDB - exception catched Not a SCALAR reference
by pjkang7 (Novice) on Nov 24, 2015 at 17:47 UTC

    Well, this does not stop my script from executing, I think it's just an exception catched warning (or error) from PTKDB tool.... which gets printed out when I step through the code... there really isn't much to the code. I think i will just ignore that and move on....

    Maybe it doesn't like the "ugly" syntax.... maybe I should stop using that syntax.

    Thanks for the elaborate examples though :) I do use lots of those in my script, and actually had some bug involving the exact same example of the "more complicated" ones

    @{$$href{inner_array}}

    ^ is how my code looks like and had got it wrong initially... i think i should change my syntax style.

    Thanks!!