in reply to Sieve of Eratosthenes Golf?

I'll start the bidding at 99 characters.
my%x;my$l=pop;for(2..$l){$x{$_}||=0||do{my$m=2*$_;{$x{$m}=1;($m+=$_)<= +$l&&redo}}}grep!$x{$_},keys%x

Replies are listed 'Best First'.
Re^2: Sieve of Eratosthenes Golf?
by cazz (Pilgrim) on Apr 07, 2005 at 03:50 UTC
    Unneeded variable declaration, 9 stroke penalty!
    $x=pop;for(2..$x){$x{$_}||=0||do{$m=2*$_;{$x{$m}=1;($m+=$_)<=$x&&redo}}}grep!$x{$_},keys%x