http://www.perlmonks.org?node_id=989784


in reply to Re: list separation
in thread list separation

Thank you for your help:), Is it however also possible to create a variable, its name consisting of another variable's value?

$ast = "best"; $fred = "date"; $"$ast" = 1; print "$best";

the variable $best should have been created by using the value of $ast as it's name

Replies are listed 'Best First'.
Re^3: list separation
by GrandFather (Saint) on Aug 26, 2012 at 05:21 UTC

    There are ways of doing that in Perl, but it's worse than picking your nose in public - don't do it.

    If there is some aspect of the code I presented that you don't understand ask about it instead of thinking up ways to avoid it. I suspect you are having trouble with Perl's hashes. If you expect to spend any significant time writing Perl understanding Perl's hash (associative array) data type is critical to using the language well. See perldata for information about Perl's data types. There is a lot to take in there. Take it a little at a time. Back up to the start of a section when you hit a bit you don't understand right off. If something really doesn't make sense come back here and ask.

    True laziness is hard work

      Thank you and you are absolutely right, I know what you wrote is right only I don't understand why yet and how.Thank you as well for shaping me to be a decent perl programmer who does not do the equivalent of picking his nose in public in perl:) I appreciate your help, I am going to study hashes now:P