sanju7:

(a) The code for some reason doesn't logs the message when its success. When tested with a single IP its logging successfully though.

You're not being very specific on *which* log isn't updated. Looking at your code, I can think of several possibilities:

(b) I am not getting how to expand an ip address which is a network (eg:10.3.3.0/24).

There are lots of ways to do it. For the example you give, 10.3.3.0/24, the first 24 bits of the address should remain a constant: 10.3.3, and you should vary the last eight bits through the values 1..255. So first you need to detect that your address needs to be expanded, then figure out which part(s) of the address need to vary, and then generate the appropriate sequence. So the code that does the work on an IP address should be in a subroutine. Then you can call it in a loop for each address in the expansion.

I get the feeling that you're trying to bite off too much at a time. You might consider breaking your project into distinct chunks, and solve each chunk individually.

...roboticus


In reply to Re^5: Telnet list of IP and get information stored to a file by roboticus
in thread Telnet list of IP and get information stored to a file by sanju7

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.