Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: How can I create an array that holds number of variables with values?by Russ (Deacon) |
on Dec 27, 2000 at 03:36 UTC ( [id://48368]=note: print w/replies, xml ) | Need Help?? |
Your question almost answers itself
Use an array instead of multiple, distinct variables. turnstep is right, you don't have to initialize all the variables to zero, just create them where you need them, giving a value at that time. runrig's code (my @array = map {0} 0..19) works fine here, as well.
In Section
Seekers of Perl Wisdom
|
|