Help for this page

Select Code to Download


  1. 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) {
    
  2. or download this
    die "Usage: $0 [-c] [-v] <-f pattern-file | subnet/netmask> file [file
    +...]\n" unless @ARGV || defined $opt_f;
    ...
    if ( @ARGV ) {
    
  3. 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) ;
    
  4. 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;
    
  5. or download this
        # grep each file
        for my $FNAME (@ARGV) {
    ...
            }
    
            open ($INFILE, "<$FNAME") ;
    
  6. or download this
        # grep each file
        for my $FNAME (@ARGV) {
    ...
                warn "Cannot open '$FNAME' because: $!";
                next;
            };