Hopfi has asked for the wisdom of the Perl Monks concerning the following question:
Hi there!
Was wondering if you can create arrays with the name of another variable. I dont know how to explain it better. Heres an example:
Any idea if thats possible? Cheersmy @names = qw(A B C D); for(my $i=0; $i<4; $i++) { my @$names[$i] = ($i); }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Variable as name of array
by bart (Canon) on Nov 01, 2012 at 21:33 UTC | |
by sundialsvc4 (Abbot) on Nov 02, 2012 at 01:59 UTC | |
Re: Variable as name of array
by fishmonger (Chaplain) on Nov 01, 2012 at 20:37 UTC | |
by Hopfi (Novice) on Nov 01, 2012 at 20:55 UTC | |
by johngg (Canon) on Nov 01, 2012 at 22:50 UTC | |
by choroba (Cardinal) on Nov 01, 2012 at 22:56 UTC | |
Re: Variable as name of array
by tobyink (Canon) on Nov 01, 2012 at 21:05 UTC | |
Re: Variable as name of array
by toolic (Bishop) on Nov 01, 2012 at 20:36 UTC |
Back to
Seekers of Perl Wisdom