in reply to Re: Help requested to find the cause of an "uninitialized value" message
in thread Help requested to find the cause of an "uninitialized value" message

Thank you for your thoughts.

Following a few smaller-test-cases, and reading through all the comments provided, I think I now understand the nature of the error-message ...
... and as you suggest, that the result of eval $dumper is null which when evaluated within %{ .... } is therefore attempting to de-reference a null value.

So yes, I can check to see if %info = %{ eval $dumper } results in an empty %info which I can then use as a trigger for a break-point or for some printing of some extra information.
Thank you for your thoughts and time.
Andrew

Replies are listed 'Best First'.
Re^3: Help requested to find the cause of an "uninitialized value" message
by Anonymous Monk on Jan 25, 2022 at 18:32 UTC

    You might want to check the results of eval $dumper before you try to use them as a hash reference. Something like

    my $hash_ref = eval $dumper;
    if ( ! defined $hash_ref ) {
        # You got undef. Handle it as appropriate
    } elsif ( 'HASH' eq ref $hash_ref ) {
        # You actually got a hash ref. Handle it.
    } else {
        # You got something, but not a hash ref.
        # You don't say this has happened to you, but
        # when troubleshooting, paranoia is justified.
    }