Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Running subroutines asynchronouslyby MadMax (Novice) |
on Apr 04, 2002 at 00:24 UTC ( [id://156507]=perlquestion: print w/replies, xml ) | Need Help?? |
MadMax has asked for the wisdom of the Perl Monks concerning the following question: ⭐ (subroutines)
Is there a way to run a sub-routine in a non-linear fashion? For example, I need to ping to 100 ip's to check the connectivity of my entire system. (linear method) I currently ping each ip individually "one at a time" and wait for the entire list to complete. This can take a while if I set a 2 second timeout on the ping. (non-linear method) What I would rather do is use a subroutine to ping each ip "in the background (in unix: a command followed by a '&')" and then wait until each of the ping subroutines reports back (or an appropriate amount of time) and compile the results. Originally posted as a Categorized Question.
Back to
Seekers of Perl Wisdom
|
|