Yes it's possible, but it's a very bad idea so I'm not
going to tell you how.
For more information on why it's such a bad idea, search
this site for information on "symbolic references".
--
<http://www.dave.org.uk>
"The first rule of Perl club is you don't talk about
Perl club."
| [reply] |
Use hashes.
Here's the basic thing - Perl stores all variables in a symbol table, which is just a special kind of hash. If you want to create your own personal symbol table, use your own personal hash.
Now, you're going to say that hashes can only store scalars as their values, and you'd be right. However, use straight, normal, basic references. Thus, if it's a scalar, you just store it. If it's an array or hash (or even a subroutine!), you store a reference to it, and dereference it as necessary. (Use ref to figure out what's what, if you need to, but you shouldn't.)
------ We are the carpenters and bricklayers of the Information Age. Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement. | [reply] |
Why would you want to create alot of variables at runtime when you can just create one that will hold all your values?
read The Basic Datatypes, Three I think you are looking for @ as Zaxo suggests, or %
<edit> I'm not saying it can't be done though. </edit> | [reply] |
Certainly# produces an array of $/ delimited records -- lines ususally
my @asd = <STDIN>;
Further manipulation gets you whatever you can extract.
Update: Oops, misread the question. Listen to davorg.
After Compline, Zaxo
| [reply] [d/l] |