Thanksopen ( SAVE, '>primes.dat' ) or die "Couldn't open primes.dat"; @primes = ( 2 ); $testnumber = 3; while ( 1 ) { foreach $placeholder ( @primes ) { if ( ( $testnumber / $placeholder ) =~ /^[+-]?\d+$/ ) { $testnumber = $testnumber + 2; next; } if ( $placeholder == $primes[-1] ) { push ( @primes, $testnumber ); print SAVE "$testnumber\n"; } next; } }
In reply to Strange saving behaviour by Mandor
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |