Running multiple SUB program at the same time

Posted on 2004-04-27
Last Modified: 2010-03-04
Hi gurus

Is there a way to run multiple SUB progrmans at the same time in one PERL script ? Or do I need to make multiple PERL scripts ?

So let's asume that I have program:


#!/usr/bin/perl -w

use Net::FTP;



I need to run those sub scripts at the same time and I don't want to PERL ends with the firs FTP before moving to second one.

Thanks for any advise

- Jussi

Question by:salmjuh
  • 2

Expert Comment

ID: 10935926
U can try threading:

use Thread;

Expert Comment

ID: 10935948

Accepted Solution

PerlKing earned 50 total points
ID: 10945826

Using this module, you can write a loop like a "foreach" loop. But the good thing is that all the iterations of the loop happen parallely. You can also specify the parallelism you need.

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (,  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question