in reply to Re: Filling an array
in thread Filling an array

Doh, you are correct. I changed usually use for loop code like this:

for ($i=0; $<100; $i++) { push(@arr,1); }

but that was before I knew about the CODE tags, so I figured it would be easier to just change it to an equal sign. I forgot you needed two of them :)

Replies are listed 'Best First'.
Re: Re: Re: Filling an array
by Anonymous Monk on Sep 07, 2001 at 23:48 UTC
    I like this style of for loop, since there are fewer
    chances for a typo:
    push(@array,1) for(0..99);

    And you can incorporate the multiplier with your push:
    push(@array, $_ * 3) for(0..99);

    -blyman