Help for this page

Select Code to Download


  1. or download this
       my @bad_ports = qw(12345 12346 20034 8787 31337 31338 54320 54321);
       while(<FWLOG>){
    ...
             } 
          }
       }
    
  2. or download this
       # I'd separate this out and put it in a configuration section of th
    +e script
       my $bad_ports = '12345|12346|20034|8787|31337|31338|54320|54321';
    ...
       while(<FWLOG>){ 
          print if (/\b($bad_ports)\b/o);
       }
    
  3. or download this
    # Build the hash
    my %bad_ports = (12345=>1, 12346=>1, 20034=>1, 8787=>1, 31337=>1); # s
    +hort list
    ...
       my $port = extract_port_from($_); # fill in a regex here
       print if $bad_ports{$port};
    }