Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I might take issue with some of your proposals: (I've taken the liberty of numbering your points)
  1. Looks good. Makes sense.
  2. Hmm. I'm a little hazy on this one, but I'd say that calling ping in backticks would be a bad idea. 1) You don't know which binary will execute since you are not providing an absolute path. A config script would be needed to get this right. I find that too complicated for this nice all-Perl module. 2) ICMP echo was intended for privileged users. Don't try to circumvent this in this library. No other UNIX lib allows you access to ICMP. Only some tools are setuid(0). Abusing this in a lib is a bad idea. 3) The returned string from the backtick call will be very system dependent. It would have to be configured individually for every system and various versions of ping. If you don't have access to ICMP, then you don't. Forget it and try something else.
  3. Interesting, but sort of "beginner's"-level functionality. I guess it might work, but it might take a long time to confirm a computer's existence if each level has to fall back on the next. The newbie may become entirely discouraged after waiting for 15 seconds for ping results for the machine next to him. Instead, in the docs, explain that it may be beneficial to use `ping` instead of this module under certain circumstances.
  4. alarm would be poor programming style to begin with. This should immediately be replaced with a select or setsockopt with SO_RCVTIMEO or fiddle with IP_TTL (choose appropriately for each protocol).
  5. This is something I wouldn't like at all. Again, it may seem like "cool" functionality for the beginning user, but it is really misleading. It can too easily get out of control and wastes resources. Such things are best left to threads and threaded apps like sping which does exactly what you wish already. Imagine the user firing off 20 of these pings, all of which fork off a `ping`. That's 40 processes==bad news==looks like runaway process. Instead, humbly suggest the use of sping in your docs or make your function simply line them up for pinging. By the way, how would you be returning results? You would be waitpiding say for 20 processes which fire off `ping` to exit, all of which take .25 seconds to startup (theoretically speaking), then you have a maximum wait of 15 seconds even if you specified a timeout of 5 seconds- very confusing stuff here. If the user wants to waste his time doing that, then let him, but don't build this into a much used and abused library.
I'd be happy to try your new version on AtheOS, perhaps one of the most obscure yet user-friendly OSs in existence. 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.

In reply to Re: A proposal for improvements to Net::Ping by AgentM
in thread A proposal for improvements to Net::Ping by Falkkin

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (6)
As of 2024-04-23 07:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found