There are several way for this to be done. Since the entire process is in Perl, an presumably in Perl, there are forking, and threads.
Threads are somewhat (very) experimental and should not be used for production work, so,
fork.
I would read up on the
fork function, and maybe take a look at super search, or the book "Network Programming with Perl".
remeber the immortal word's of Socrates who said, "I drank what ?"