Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: list separation

by robertw (Sexton)
on Aug 26, 2012 at 04:28 UTC ( #989784=note: print w/ replies, xml ) Need Help??


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


Comment on Re^2: list separation
Download Code
Re^3: list separation
by GrandFather (Cardinal) 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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://989784]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (12)
As of 2014-08-20 15:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (118 votes), past polls