in reply to
I am not able to join a thread when another child process is running which was forked using open.
Here is what I recommend:
First, get your thoughts in order. Devise what you want the end result to be, and avoid getting distracted by how to get to those results.
Now, as for “how to get to those results,” start hauling out the big-guns like Parallel::ForkManager.
What I am really trying to say here is that, “the real important thing about the Perl language is: http://search.cpan.org. Where, at this particular moment in time, you will find 75424 Uploads, 24,169 Distributions; 103,218 Modules; 9,487 Uploaders, literally about every conceivable subject or task including rocket-science. Therefore, no matter what it is that you are doing, you do a lot less “original programming” and a lot more “picking and choosing.” And so, that is what I think you should be doing here.
When you install almost any of those packages onto your system, it subjects itself to hundreds or even thousands of self-tests. It has been subjected (via the so-called CPANTS testing-service) to test-runs on a myriad of actual environments. Links to this, and to bug and issue reports, are all there on the same page. So, you have just been handed a magic bridge that runs over many stinking swamps of wasted time.