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