Mandor has asked for the wisdom of the Perl Monks concerning the following question:
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; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Strange saving behaviour
by ChOas (Curate) on Feb 01, 2001 at 19:19 UTC | |
|
Re: Strange saving behaviour
by davorg (Chancellor) on Feb 01, 2001 at 19:20 UTC | |
by arhuman (Vicar) on Feb 01, 2001 at 19:31 UTC | |
by ichimunki (Priest) on Feb 01, 2001 at 20:42 UTC | |
by arhuman (Vicar) on Feb 01, 2001 at 20:49 UTC | |
by ichimunki (Priest) on Feb 01, 2001 at 21:04 UTC | |
|
Re: Strange saving behaviour
by arturo (Vicar) on Feb 01, 2001 at 19:30 UTC | |
by ChOas (Curate) on Feb 01, 2001 at 19:37 UTC | |
by davorg (Chancellor) on Feb 01, 2001 at 19:45 UTC | |
by arturo (Vicar) on Feb 01, 2001 at 19:42 UTC | |
by ChOas (Curate) on Feb 01, 2001 at 19:45 UTC |