The stupid question is the question not asked | |
PerlMonks |
Re: Initialization of arraysby sk (Curate) |
on Sep 22, 2005 at 14:02 UTC ( [id://494120]=note: print w/replies, xml ) | Need Help?? |
chester and svenXY have told you why it does not do what you want and how you can init the slice. Here is a quick way to init if you want to do it for a large number of indices.
BTW, you had @x[1..3] I changed it @x[0..3]. I felt that is probably what you want as the array index starts with zero. If you are sure you don't need zero then you can modify my code. -SK
In Section
Seekers of Perl Wisdom
|
|