in reply to Re: Dynamic Dereferencing
in thread Dynamic Dereferencing

String eval is not to be used . especially not as a substitute for functions and loops for dereference

Replies are listed 'Best First'.
Re^3: Dynamic Dereferencing
by markong (Pilgrim) on Dec 07, 2018 at 14:41 UTC

    ?

    I was replying to the OP on why he had that error and the only reasonable way to correct that code. I never recommended eval-ing concatenated strings as a good practice. The opposite as a matter of facts!

    Eval()-ing has, of course, its use cases, but as I said, it's dangerous in this particular case. One of the reasons of why I encouraged using some of the mentioned CPAN alternatives, if possible, to navigate nested structures.