Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Need a couple of scripts - help?

by dguntner (Novice)
on Jul 21, 2007 at 05:45 UTC ( #627944=perlquestion: print w/replies, xml ) Need Help??
dguntner has asked for the wisdom of the Perl Monks concerning the following question:

Hello monks,

I'm trying to help out a friend who needs a couple of scripts for something that he's doing at work. He asked me for help. Unfortunately, I only know perl well enough to read it. Kind-of. Sort-of. Ok, maybe a little bit. :-) Someone told me that the people at this website are friendly and helpful, and that sounds like what I need at the moment! *grin*

So, here's what I need. As mentioned, two different scripts are needed:

Script 1)

Ping a range of IPs
display the ones that responded sorted by response time......

Script 2)

traceroute a specific IP address
disply the hop that has the longest latency......

The scripts do need to be in perl (there are People Who Want It In Perl involved :) ), so if anyone here could assist me by providing me with these (and maybe an explanation of how they're doing what they're doing, if you feel like it - I *would* like to learn more about perl), you would make me one really happy guy! :-) Thanks!

Oh, and if it matters, this will be used on a Linux system.


Replies are listed 'Best First'.
Re: Need a couple of scripts - help?
by planetscape (Chancellor) on Jul 21, 2007 at 06:26 UTC

    I appreciate your altruism. PerlMonks are friendly and helpful, but generally do not produce scripts on request, no matter how polite.

    We will bend over backwards to help you write your own scripts, but we do ask that you show some effort of your own to help yourself.

    Show us some code. Ask specific questions about where you are having problems. Perhaps take a tour of Tutorials, or Categorized Questions and Answers. Remember that Super Search is your friend.

    Good luck!


      Thanks for those link pointers (tutorials, etc.). I'll look them over and see what I can come up with. Personally, I tend to cringe at "search" items on webpages - they usually aren't all that useful to me - I can never seem to come up with the right keywords. 8^) But I'll give the Super Search a try - who knows, maybe I'll get along with this one! *grin*



Re: Need a couple of scripts - help?
by Your Mother (Bishop) on Jul 21, 2007 at 06:32 UTC

    I think you're gunning for trouble. Most of the best who help out here make good green doing it and requests to do work for which others are to be paid is not gonna go over well. Even when politely made.

    If you want help, you'd better make an effort to write the scripts, at least try. Search around and see what's already done. Tons of code out there. Google searches code okay now. See what you can come up with by your own effort. Then bring it here and try again. Otherwise, doom and misery is the forecast. Unless you're offering cash. Plenty of trainers and contractors here for that. :)

      I apologize if I offended you in some way. I'm not being paid anything for this, and my friend wants the scripts to make some testing that he has to do easier on him. To the best of my knowledge, this isn't something he's being paid a bonus to do. Sorry I didn't "offer cash" for something that I'm not being paid for myself - I just get by from one paycheck to the next, so I don't have a lot of money to throw around. :-) I was simply trying to help someone, but as I've mentioned, I don't know enough about perl to even know where to start on something like this (kind of hard to come up with starting code to offer up here for review/suggestions under those conditions).

      I *am* interested in learning more about perl; I was hoping that the Hacker's Ethic was still alive in this day and age (which is why *I* am trying to help someone). That's why I came here. It seemed from what I was told by another that this would be a good place to start and to ask for help. In the past, when I've been asked for help of this type of nature, if I knew how to write the script or program, I just did so and provided it, with explanations as to how what was doing what. I personally learn best from working examples (reading a man page for something that I'm unfamiliar with isn't all that helpful to me - they're useful when I already understand the subject), so I tend to use that technique when I'm helping someone to learn about something. I was hoping that someone here would have the same sort of mentality. Perhaps I was mistaken in that hope.

      You say that Google searches code ok now - that's good news at least. I'll see if I can figure out what the best terms are to find something useful. :-)


        Most of us see PerlMonks as a place to exchange information and pass on experience to bring others up to speed with Perl. Although a huge amount of code is written in answer to questions, there is a strong emphasis on helping solve problems through enlightenment rather than simply providing a canned solution.

        If you are a programmer then the appropriate first question is not "Do this for me", but "How might I go about this?" or "What tools would help with this?" or (even better) "I tried this, but I got stuck on that. What have I done wrong?". And the first step preceeds the first question to the monks - search for answers yourself. You've been given a few places to look already (see, we are friendly and helpful).

        In particular, Super Search is indeed a good tool for seeking information here. A search on response time ping ip turns up Ping multiple hosts (fork implementation) among other nodes (a little winnowing is required). A search on traceroute turns up Timing out a traceroute. Those are large leg ups in your code quest and, hey look, someone else has written it for you already! Now tell me, were those two searches too hard? The search key words were pulled straight out of your problem descriptions.

        Welcome to the monastery by the way. If you stick around just a little while pretty likely you will find us friendly and helpful. ;)

        DWIM is Perl's answer to Gödel
        Don't forget that there are working scripts available here that are valuable in learning something new with working code as the example. Checking out the Networking Code from the Code section shows a few scripts on pinging such as this one that should get you started on what you are trying to do.

        "The trouble with having an open mind, of course,
        is that people will insist on coming along
        and trying to put things in it."
        - Terry Pratchett

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://627944]
Approved by planetscape
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2018-06-23 06:56 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (125 votes). Check out past polls.