As you say you are new to perl, here are some handy hits:
- use strict;
- use warnings;
- Employ a consistent indentation policy
- Don't refer to processes as "threads" when they aren't actually threads.
Having said that, it isn't clear from your post what your "own purposes" might be or in what way your sample code fails to address them. Nor is it clear why you aren't using Parallel::ForkManager for this when it would appear to suit the bill. Some further explanation and detailed statement of the problem would be better.