in reply to Re: Parse data representing hash
in thread Parse data representing hash

Thank you,

This information is very useful. If I understand correctly your suggested design is much like what choroba has suggested below, which appears to build the state into an array and pass this to the core DiveRef function.

Regards,

Chris

Replies are listed 'Best First'.
Re^3: Parse data representing hash
by LanX (Saint) on Jun 28, 2014 at 22:45 UTC
    Similar but not identical from what I see.

    I'd rather keep the values° in @path, choroba keeps the keys.

    Like this I don't need any dive function, the ref of the hash to be extended is already available (or must be autovivified if undef)

    update
    The only complication is that you prefer undef instead of an empty hash for leaves of your HoH tree, which leads to a test condition in edge cases.

    Cheers Rolf

    (addicted to the Perl Programming Language)

    °) or even the refs of the values

      Thanks again, either undef or an empty hashref is fine, either can easily be processed later. I'm currently attempting to implement your suggestion as an alternative to the Data::Diver solution, its pretty late here and my brain is frazzled but I am making progress!