in reply to Sieve of Eratosthenes Golf?
my%x;my$l=pop;for(2..$l){$x{$_}||=0||do{my$m=2*$_;{$x{$m}=1;($m+=$_)<= +$l&&redo}}}grep!$x{$_},keys%x [download]