in reply to spawning Perl scripts

Try use a perl module Thread, Thread::Queue, Thread::Specific and Thread::Semaphore ,
Perl threads tutorial or Old Perl threads tutorial.
Good like!
--------> SV* sv_bless(SV* sv, HV* stash);