- or download this
die("Usage: $0 [-c] [-v] <-f pattern-file | subnet/netmask> file [file
+...]\n") unless ( (defined $#ARGV && $#ARGV > -1) || (defined $opt_f
+) ) ;
...
if ( defined $#ARGV && $#ARGV > -1) {
- or download this
die "Usage: $0 [-c] [-v] <-f pattern-file | subnet/netmask> file [file
+...]\n" unless @ARGV || defined $opt_f;
...
if ( @ARGV ) {
- or download this
# remove non-ip-address characters, trim, break into words
+ to validate
$IP_LINE =~ s/[^0-9.]+/ /g ;
$IP_LINE =~ s/^ // ;
$IP_LINE =~ s/ $// ;
my @WORDS = split(/\s+/,$IP_LINE) ;
- or download this
# remove non-ip-address characters, trim, break into words
+ to validate
$IP_LINE =~ tr/0-9./ /c;
my @WORDS = split ' ', $IP_LINE;
- or download this
# grep each file
for my $FNAME (@ARGV) {
...
}
open ($INFILE, "<$FNAME") ;
- or download this
# grep each file
for my $FNAME (@ARGV) {
...
warn "Cannot open '$FNAME' because: $!";
next;
};