I'd suggest trying using netcat to test whether echo/tcp and echo/udp are actually available.
Otherwise, you are probably looking at implementing a similar functionality using Net::Telnet (using the POP port)
I posted a CUFP
here. From which you could probably quite easily nab the 'OpenConn' sub to do what you want.
--
It's not pessimism if there is a worse option, it's not paranoia when they are and it's not cynicism when you're right.