Or rephrasing Re: Easy way to list prime numbers 1 to 100 with the actual calculation taking one single grep statement:
my ($MAX,@comp)=100; my @prime=grep {my $i=$_; !$comp[$i] && map $comp[$i*$_]++, 1..$MAX/$i +} 2..$MAX;
In reply to Re: Easy way to list prime numbers 1 to 100
by blazar
in thread Easy way to list prime numbers 1 to 100
by l.frankline
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |