If you want to go the thread way:
Create two queues - one for read data and one for write data.(Thread::Queue)
Start x workers as detached (I would make this a parameter) and a result writer also detached.(threads)
Workers read from the inqueue and send results to the result queue.
Program terminates either when lines read = lines written or when the result queue is empty for x seconds.
The main question is the bottleneck, but I have used this approach quite frequently on multicore machines with success.

In reply to Re: How do you parallelize STDIN for large file processing? by weismat
in thread How do you parallelize STDIN for large file processing? by forsaken75

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":