Help for this page

Select Code to Download


  1. or download this
    foreach (@lines) {
      if(/(\w+)\s+(\w+:\w+)\s+(\d+\.\d+\.\d+\.\d+):\w+\s+(\w+)/) {
    ...
        print "$protocol, $localAddress, $foreignAddress, $state\n";
      }
    }
    
  2. or download this
      open NETSTAT, "$program|" or die "Cannot open netstat $!\n";
      while (<NETSTAT>) {
    ...
          # protocol, localAddress, foreignAddress, state
        }
      }