in reply to multithreading sample

I am not sure if this is too much for the task you are looking for

But here are some parallel processing modules

Parallel::ForkManager

Proc::Queue

Sample codes are available in the docs

-SK