Since I'm not able to test the code myself, I was expecting you to actually try to read it first, before running it. Just because you don't know much about programming now, this doesn't mean you can't start to learn a little about programming...

The line cited in the error message is the place where you have to insert some code yourself, which will translate the host name into an IP address (this is mentioned in the comment next to that line). Do you not know how you are getting the IP address for a given host name in your existing script?

Let's suppose you use a unix command like "host" to get an IP address -- e.g., on my macosx/BSD box, looking up the IP for perlmonks.org goes like this:

$ host www.perlmonks.org www.perlmonks.org is an alias for perlmonks.org. perlmonks.org has address 209.197.123.153 perlmonks.org has address 66.39.54.27
Probably you'll only get one IP per host in your list, and in any case, the first IP you get will probably work. So replace that line causing the error with something like these two lines:
my $ip = `host $host`; $ip =~ s/.*?(\d+\.\d+\.\d+\.\d+).*/$1/s;
Now, if that fixes the syntax error but other problems still remain, you can just keep popping back for more corrections (which will annoy the rest of us), or you can start looking things up on your own, and see if you can figure out what to try next.

In reply to Re^3: snmpwalk to CSV #2 by graff
in thread snmpwalk to CSV #2 by getwithrob

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.