in reply to Re: Saving an array to a disk file
in thread Saving an array to a disk file

I might be barking up the wrong tree here but I think your

$#array = $i;

should be

$#array = $i - 1;

because the $i subscript has been post-incremented ready to receive the next value in the ... while <$in>; loop. I don't think you can get 32768 unique values when generating them with ... int rand 32767 ....

Cheers,

JohnGG

Replies are listed 'Best First'.
Re^3: Saving an array to a disk file
by BrowserUk (Patriarch) on May 26, 2006 at 09:54 UTC

    Indeed you are absolutely correct! Updated, thankyou++.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.