http://qs1969.pair.com?node_id=717340


in reply to Re: A Simple Socket Server Using 'inetd'
in thread A Simple Socket Server Using 'inetd'

You can, though I'm not sure if there's any quirks to it (including how it behaves when not run from inetd)
my $hersockaddr = getpeername(STDOUT); my ($port, $iaddr) = sockaddr_in($hersockaddr); my $ip = inet_ntoa($iaddr);
That gives you $port and $ip nicely ready to use.