in reply to telnet ip address

If you are using *nix, robobunny's solution looks easy enough and you can use perl instead of the pipeline to process the output of 'who'. OTOH, if you want a slightly more perlish solution, you can use Sys::Utmp to look up the login record. You can find out what the login device is with the shell's tty command.

If you want to support *nix, Win*, etc, I'd possibly put a shim on port 23 (telnet) so it logged the connection somewhere before starting the real telnet daemon.

Win32 may have an environment variable you could use instead, but that probably depends on what telnet server you are using. I suggest CLIENTNAME is a place to start. HTH, --traveler