True to the seive, it starts at k=2 eleminates n*k, then steps to next prime and repeats until k >= sqrt(n). Instead of mapping to 0 I would have loved to just drop them -- not bothering w/ the regexp for cleanup -- but I couldn't for the life of me figure out how.

The subroutine is recursive mainly b/c I had yet to try that technique and this seemed like a good time to try.

Thanks to Petruchio for his rewording of ($k,@_)=($#_)?@_:2..($n=@_[0]) so I didn't produce an error. So far this seems like a great place to learn programming.</fawning>

Update

Scratched recursion and went w/ a conventional for loop, brought it down to 87 chars w/ strict compliance.

# non-strict
sub c{$n=pop;@_=2..$n;for($k=2;$k<=sqrt($n);($k)=@_){@_=grep!/^0/,(map
+{($_%$k)?$_:0}@_),$k}@_}
# strict w/ less named vars
sub c{pop;@_=2..$_;for(my$k=2;$k<=sqrt;($k)=@_){@_=grep!/^0/,(map{$_%$
+k?$_:0}@_),$k}@_}