Perl Question part duex

Thanks guys. You know what my problem was? I had open (PRIME,
“>$filename”); to open the existing file and read from it! aragg! :wink:

Next question, I write each new prime number to the file, and then the
program needs to check each new number against the known primes. This
means that each new prime must be written to the file before the next
number is tested, except that writing only occurs when I close the file,
so every time I write a new prime, I need to open, print, and close. This
saps speed though, is there a different way to empty the output buffer
without closing and re-opening the file every time, or won’t this save
any speed?

Dan

BTW: sorry for the double post, I didn’t know if you saw the old one since
it’s several days old.

Dan