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 togetherThere 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:
From the command line, use perldoc:=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
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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |