in reply to Re: Contain yourselves please: THEORETICAL question about variable values being used as A PART of another variable's name.
in thread Contain yourselves please: THEORETICAL question about variable values being used as A PART of another variable's name.

That is terrible code.
  • Comment on Re^2: Contain yourselves please: THEORETICAL question about variable values being used as A PART of another variable's name.

Replies are listed 'Best First'.
Re^3: Contain yourselves please: THEORETICAL question about variable values being used as A PART of another variable's name.
by stevieb (Canon) on Dec 15, 2016 at 18:41 UTC

    Which is one of the reasons we repeatedly state not to use such code.

    Dominus says it best.

      > Which is one of the reasons

      Not really, there are many reasons, but that's not part of it! :)

      Ikegami's code is just a condensed one liner version of

      $string= "construct variable name"; say $$string;

      not much different from dereferencing syntax.

      On another note: Someone is trying to troll here ATM, better don't feed. :)

      Cheers Rolf
      (addicted to the Perl Programming Language and ☆☆☆☆ :)
      Je suis Charlie!

Re^3: Contain yourselves please: THEORETICAL question about variable values being used as A PART of another variable's name.
by ikegami (Patriarch) on Jan 13, 2017 at 18:48 UTC

    Of course it is. That was already made extremely clear by the following:

    this is purely a curiosity and NOT for actual implementation anywhere....EVER. I know one should not do this i know what should NEVER EVER do this.....one should use hashes etc.... etc.....I know....

    So yeah, we shouldn't use symbolic references, which is why we ask perl to prevent us from using them by adding use strict; to our code. It's extremely clear that the OP knows this too, but they wanted to know how to use them anyway. Some low-level code (e.g. exporters, OO frameworks, namespace cleaners, etc) require using them, and its possible the OP is working on such code.