Very Cool!
Question:
How would you modify this so that the main process could send messages/data to the threads?
I don't have a true multi-processor system, so I can't say whether this is faster than just running one big sequential file, but it is a useful techique for monitoring the output of threads.
My machine has 8 cores (Intel Core i7) and this is the result after running it:
jdrago999@e6510:~$ time perl Desktop/thread-prime.pl
........lots of output here..........
real 0m3.314s
user 0m11.540s
sys 0m0.490s