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.
(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.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Running subroutines asynchronously⭐
by NetWallah (Canon) on Oct 03, 2005 at 04:31 UTC | |
by blazar (Canon) on Oct 03, 2005 at 08:52 UTC | |
Re: Running subroutines asynchronously⭐
by crazyinsomniac (Prior) on Apr 04, 2002 at 08:01 UTC | |
Re: Running subroutines asynchronously⭐
by ehdonhon (Curate) on Apr 04, 2002 at 03:20 UTC | |
Re: Running subroutines asynchronously
by tachyon (Chancellor) on Apr 05, 2002 at 00:43 UTC |
Back to
Seekers of Perl Wisdom