listanand has asked for the wisdom of the Perl Monks concerning the following question:
Hi perl monks,
I have a situation where I need to create array dynamically (on the fly). I have specific names also by which the arrays need to be created. Here's an example code snippet:
my @array_names = qw (a b c d e f);
Now, I try the follwing:
for my $name (@array_names) {
@$name=();
}
So far so good. But then when I try to access one of the arrays, say @a, the compiler complains.
Any suggestions? Thanks in advance.
Andy
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Creating Arrays Dynamically
by GrandFather (Saint) on May 23, 2010 at 23:27 UTC | |
Re: Creating Arrays Dynamically
by liverpole (Monsignor) on May 24, 2010 at 00:54 UTC | |
Re: Creating Arrays Dynamically
by toolic (Bishop) on May 23, 2010 at 23:48 UTC | |
Re: Creating Arrays Dynamically
by choroba (Cardinal) on May 23, 2010 at 22:57 UTC | |
by listanand (Sexton) on May 24, 2010 at 21:21 UTC |
Back to
Seekers of Perl Wisdom