in reply to Re^2: Recursive search in nested hash for selective keys
in thread Recursive search in nested hash for selective keys

I'd pass $key_val in as a third parameter (actually the second parameter with $key the last). However, that doesn't seem to be the real problem. I suspect all you need to do is assign an empty hash to $key_val between iterations to clear the previous contents.


True laziness is hard work
  • Comment on Re^3: Recursive search in nested hash for selective keys

Replies are listed 'Best First'.
Re^4: Recursive search in nested hash for selective keys
by perlpal (Scribe) on Aug 12, 2009 at 16:32 UTC
    I passed a third parameter as $call with a value "main" if called from outside or value "sub" if called recursively within.
    $key_val = {} if ($call eq "main");