Net::Netstat::Wrapper - Perl module for getting the current tcp open ports
Netstat module provides to you a simple way for getting the current tcp open ports
(ports, ip address interfaces) on a local system (Linux, Win*, Mac OS X 10.3.9).
use Net::Netstat::Wrapper;
print "\nTcp open ports:\n\n";
@netstat = Net::Netstat::Wrapper->only_port();
for (@netstat) { print "$_\n"; }
print "\nLocal address and tcp open ports:\n\n";
@netstat = Net::Netstat::Wrapper->ip_port();
for (@netstat) { print "$_\n"; }
print "\n- PID/Program name:\n\n";
@netstat = Net::Netstat::Wrapper->pid_pname();
for (@netstat) { print "$_\n"; }
@netstat = Net::Netstat::Wrapper->only_port();
Get the tcp open ports.
@netstat = Net::Netstat::Wrapper->ip_port();
Get the local address and tcp open ports.
@netstat = Net::Netstat::Wrapper->pid_pname();
Get the pid and process's name that bind a tcp port. This method works only on Linux.
This module requires "netstat" binary.
man netstat
Matteo Cantoni goony@nothink.org
http://www.nothink.org
Copyright (c) 2005 Matteo Cantoni. All rights reserved.
This program is free software; you can redistribute it
and/or modify it under the same terms as Perl itself.