Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: Varying Variable Names

by wog (Curate)
on Oct 15, 2001 at 23:34 UTC ( #118975=note: print w/replies, xml ) Need Help??

in reply to Varying Variable Names

You can name variables with other variables, but it is strongly not reccommend. For why see this article. Instead, you should use an array of arrays, which is ultimately easier to manage. (update:) Or, depending upon what you need to do, you may find you need to, in this case, use a hash of arrays described in perldsc, along with many other possible data structures

Replies are listed 'Best First'.
Re: Re: Varying Variable Names
by willick (Novice) on Oct 16, 2001 at 00:56 UTC
    Even if it's strongly not recommended, I need to know how to do it. If I can just name my arrays @array1, @array2, etc it will be easier for what I'm doing.
      If the answer is "I need a variable-variable name", you almost certainly asked the wrong question. What question were you answering here? And what question was that a larger part of?

      -- Randal L. Schwartz, Perl hacker

      Convince us that you really need to do it (i.e. tell us a bit more about what you are doing) and we'll help you get it done. I have almost never seen an instance when @array1, @array2, etc. was the right thing to do, nor made things any easier.


Log In?

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2022-11-29 21:52 GMT
Find Nodes?
    Voting Booth?