sunder has asked for the wisdom of the Perl Monks concerning the following question:

So i am an Engineer for a ISP. I have a need to validate Customer Routers are reachable before and after a maintenance by pinging them. The current program that I use doesn't thread to speed things up so it can take a long time to complete.

Here is the overview what i am trying to do.

Give the program a list of ip's to ping in a list\array.
Thread to create a process for each ping task.
Then when the ping task completes return the outcome (Latency or Unreachable) back to the original process and put it in to array
Then print the results.

I have never done any programming with threads or forking.

First off is threads the correct way to program this?

Second does someone know of a good tutorial or have a good example?

Thanks in advance

Replies are listed 'Best First'.
Re: Howto Threads
by BrowserUk (Patriarch) on Feb 09, 2016 at 04:37 UTC

    You can do it with threads, but the simplest way is to use Net::Ping in syn/ack (asynchronous) mode. See Re: Optimized remote ping (syn/ack) for a little detail.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
    In the absence of evidence, opinion is indistinguishable from prejudice.
Re: Howto Threads
by NetWallah (Canon) on Feb 09, 2016 at 03:41 UTC
    I wrote this back in 2003 .. hope it still works:

            ...The words of the Prophets are written on the Facebook wall.