Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Default initial array value? [TMTOWTDI]
February 15, 2009, 6:27 pm
rate this thread
but here goes:
I need to initialize an array to all zeroes to begin with, but the
only way I see is to set each index manually:
my $ary = [ map 0 .. $last_index ];
Because the indices invariably get set to undef if I just set the last
index. I've read the perlvar manpage over and over again and can't
find a relevant variable to determine what undefined array indices get
set to instead of undef.
My question is, Is there more than one way to do this?