in reply to Hash of hash check if defined

Autovivification.

Change...

if(exists $ulm_keys{$h_tag}{$h_val}){....

... to ...

if( exists $ulm_keys{$h_tag} and exists $ulm_keys{$h_tag}{$h_val} ) { ...

...and see if that fixes things. What's happening is that currently as you test for the existance of $h_val, $h_tag is created automatically whether or not $h_val exists.

Here is Uri Gutman's tutorial on the subject.


Dave

Replies are listed 'Best First'.
Re^2: Hash of hash check if defined
by Jup (Novice) on Feb 21, 2012 at 16:25 UTC

    Hi Dave thanks for your quick answer. I don't think this is an autovivification issue as I've already try the following without any success :

    if(exists $ulm_keys{$h_tag} && defined $ulm_keys{$h_tag}{$h_val}){

    But I will try to check with 2 exists, just in case. Thanks again for your answer.