Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

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

Lessgo:
  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.

    Example:

    • Here's the ping output from a Solaris server:
      % ping www.agentm.com www.agentm.com : ##### www.agentm.com : 5/5 succ. = 100.00%
    • And the more familiar Linux-brand generic ping:
      PING worf4.agentm.com (208.185.131.199): 56 octets data 64 octets from 208.185.131.199: icmp_seq=0 ttl=244 time=216.6 ms 64 octets from 208.185.131.199: icmp_seq=1 ttl=244 time=216.1 ms 64 octets from 208.185.131.199: icmp_seq=2 ttl=244 time=247.6 ms 64 octets from 208.185.131.199: icmp_seq=3 ttl=244 time=235.3 ms --- worf4.agentm.com 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 agentm.com 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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://63423]
help
Chatterbox?
[choroba]: Tire chains are mandatory here in mountains, and the only unprepared each year are gritters
[stevieb]: I have a 3 day winter survival kit in my vehicle in the event I get snowed in in the mountains (which has happened before due to avalanches closing the roads (and once in the summer due to a massive forest fire that trapped us
[perldigious]: a handful of people in my work area did not make it, but I live pretty close and it's flat the whole way, so I didn't have any trouble. The roundabout is the worst thing I have to negotiate.
[thezip]: G'day all!
[perldigious]: Well, that and dodging the people who forget how ice works right away. :-)
[stevieb]: hey, thezip
[perldigious]: I don't miss having to drive up and down in elevation on roads that are iced over, I white knuckled gripping the steering wheel every time I had to where I used to live.
[perldigious]: So I don't envy you mountain guys if you have to drive in the winter, even with tire chains.
MidLifeXis waves.

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (10)
As of 2016-12-06 16:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (112 votes). Check out past polls.