H
h3xx
I know this kind of goes against traditional programming practices,
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} 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?
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} 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?