die "perl port-state-service+IP-mem-array.pl " if $#ARGV < 2; open(F0, $ARGV[0]); open(F1, $ARGV[1]); open(F2, ">$ARGV[2]"); $line_no=0; while () { while (s/^[\ \t]//g) {}; while (s/[\ \t]$//g) {}; s/\r\n//;chomp; $IP[$line_no++] = $& if /[0-2]?[0-9]?[0-9]\.[0-2]?[0-9]?[0-9]\.[0-2]?[0-9]?[0-9]\.[0-2]?[0-9]?[0-9]/; } close F1; print F2 "IP\t\tport\tstate\tprotocol\n\n"; while () { while (s/^[\ \t]//g) {}; while (s/[\ \t]$//g) {}; s/\r\n//;s/\t+/\t/;chomp;/^[0-9]+/;$line=$';$line_no=$&; $line =~ s/^[\t\ ]+//g;$line =~ s/[\t\ ]+$//g ; print F2 $IP[$line_no - 1], "\t$line\n" if /[0-9]+\//; } close F0; close F2;