Thanks in advance,#!/usr/bin/perl use Fcntl qw(LOCK_EX LOCK_NB); flock DATA, LOCK_EX | LOCK_NB or die "Already executing: $!"; my $maxprimes=200; #Stop when you've found this many my $value=1; my $count=0; while ($count < $maxprimes){ $value++; my $composite=0; OUTER: for (my $i=2; $i<$value; $i++){ for (my $j=$i; $j<$value; $j++){ if (($j*$i)==$value){ $composite=1; last OUTER; } } } if (! $composite){ $count++; print "$value "; } } # do not remove this __END__ __END__
In reply to error message not working by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |