Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re: Re: Re: A proposal for improvements to Net::Ping

by AgentM (Curate)
on Mar 10, 2001 at 06:06 UTC ( #63423=note: print w/replies, xml ) Need Help??

in reply to Re: Re: A proposal for improvements to Net::Ping
in thread A proposal for improvements to Net::Ping

  1. Check.
  2. I'm not sure building this functionality into this important module is worthwhile at all since the string returned from `ping` is completely arbitrary, system-dependent, and variable even during the lifetime of a system. That's bad news. Having to parse such a string from the module would be difficult if not impossible to anticipate. I don't really see a benefit of including this in a module since the user is free to call `ping` at anytime anyway and know the system specifics beforehand.


    • Here's the ping output from a Solaris server:
      % ping : ##### : 5/5 succ. = 100.00%
    • And the more familiar Linux-brand generic ping:
      PING ( 56 octets data 64 octets from icmp_seq=0 ttl=244 time=216.6 ms 64 octets from icmp_seq=1 ttl=244 time=216.1 ms 64 octets from icmp_seq=2 ttl=244 time=247.6 ms 64 octets from icmp_seq=3 ttl=244 time=235.3 ms --- ping statistics --- 4 packets transmitted, 4 packets received, 0% packet loss round-trip min/avg/max = 216.1/228.9/247.6 ms

    The output is completely arbitrary and impossible to anticipate. (Note that does not belong to me as it should! Copyright stealing bastards!)

  3. alarm was a poor choice to start off with. The options I mention above are far better suited for the task. History: alarm is a very old function (much older than select) and was used for similar tasks as here. It is now best to avoid this function altogether. I can't even think of a use of it in a modern threaded system.
  4. Again, if the user wants to do this, he can easily cough up a for loop to fork off ping requests, even using the module. I'd say, more than not, modules are looked towards for "good programming style", especially for beginning users. Including this would constitute teaching bad, yet functional, programming style. Honestly, again, I don't see the benefit to including this in an important module as this one. But, if you see the need to do this, perhaps name it Net::Ping::Parallel and warn about its use profusely. If you specify a number of forks less than the number of hosts to ping, you will be using some fairly heavy-duty IPC, putting reliance on yet another module and more system resources. I would definitely AT LEAST keep such code away from the standard Net::Ping. Feel free to msg me if you need additional clarification. Good luck!

AgentM Systems nor Nasca Enterprises nor Bone::Easy nor Macperl is responsible for the comments made by AgentM. Remember, you can build any logical system with NOR.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://63423]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2017-09-21 07:10 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (242 votes). Check out past polls.