>>>>> "JK" == Jenda Krynicky <[email protected]> writes:

  >> >
  >> > a.. How do I initialise an array of a definite size with
  >> > zero. Say the C equivalent of such a statement will be:

  >> my @array;
  >> $array[$_] = 0 for 0..125;

  JK> my @array = (0) x 126;

and a question for the OP is why do you need that? if you are counting
things then ++ will work on undef without warnings. initializing the
array to all 0's beforehand could be a waste if you don't need it.

uri

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/


Reply via email to