in reply to tty for each perl threads

You could try opening STDOUT (and/or STDERR) to the respective pty of the terminal emulator where the output is to be routed to, i.e. something like

open STDOUT, ">", "/dev/pts/7" or die $!;

To figure out which pty is associated with a certain terminal/shell, you can for example use

$ ls -l /proc/$$/fd/1 lrwx------ 1 almut almut 64 2010-03-22 00:16 /proc/25932/fd/1 -> /dev/ +pts/7

(on Linux, that is — paths may be different on other systems)

Replies are listed 'Best First'.
Re^2: tty for each perl threads
by sierpinski (Chaplain) on Apr 05, 2010 at 19:37 UTC
    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.
Re^2: tty for each perl threads
by ajeet@perl (Acolyte) on Apr 06, 2010 at 05:20 UTC
    Thank You...got it