in reply to Re: tty for each perl threads
in thread tty for each perl threads

What about using the 'tty' command? It should be available in Linux:
me@host> tty /dev/pts/53 my $tty = `/bin/tty`;
I *thought* that was standard for all *nix systems, but at the least it works on Solaris and several Linux distros.