in reply to CLOSE-WAIT sockets
You can't do this with perl, at least not without spoofing packets or some similar hack. If you're running on a recent version of Linux, the timeout for close-wait tcp sockets is configurable under the /proc/sys/net directory. Specifially, I think the file is tcp_fin_timeout, but someone else may want to check me on that...