in reply to Prime Iterator

It might help to replace the $num++ by $num += 2 since 2 is the only prime number that is even. This saves you half the tests for primality if you have 2 as a special case.

Best, -gjb-