Help for this page
my @bad_ports = qw(12345 12346 20034 8787 31337 31338 54320 54321); while(<FWLOG>){ ... } } }
# 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); }
# 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}; }