Welcome to the Monastery.

Rather than linking to your code off-site, since it is small enough, you can paste it here inside "readmore" tags. See Writeup Formatting Tips.

Also, you might get more specific help if you change your node title to mention something about IP addresses. See How do I compose an effective node title?.

I'm looking for feedback on a script I put together
There is a tool to help you find coding style issues: perlcritic. Here is some relevant output:
'Return value of "open" ignored at line 188, column 3. Check the retu +rn value of "open" for success. (Severity: 3)' 'Readline inside "for" loop at line 51, column 16. See page 211 of PB +P. (Severity: 4)' 'Bareword file handle opened at line 120, column 2. See pages 202,204 + of PBP. (Severity: 5)', 'Two-argument "open" used at line 120, column 2. See page 207 of PBP. + (Severity: 5)', 'Two-argument "open" used at line 188, column 3. See page 207 of PBP. + (Severity: 5)'

I'm not too familiar with IP addresses, but I know there are many CPAN modules which are.

You can convert your comments to POD and get a manpage for free:

=head1 Info Script to search text for ip address on a given subnet Subnet can be specified as x.x.x.x/x.x.x.x or x.x.x.x/xx Options are similar to grep: -c count matching lines -v select lines which do not match -f <pattern file> containing one subnet in the form above per lin +e Example: ./subnet-grep.pl 10.5.1.0/24 /etc/hosts Example: ./subnet-grep.pl -c 192.168.1.0/255.255.255.0 input1.txt inp +ut2.txt =cut
From the command line, use perldoc:
perldoc subnet-grep.pl

From the docs for printf:

Don't fall into the trap of using a "printf" when a simple "print" would do. The "print" is more efficient and less error prone.

In reply to Re: Looking for feedback on a (IP address) script by toolic
in thread Looking for feedback on a script by systemj

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.