in reply to Get output to different windows

You don't specify in which environment you are working, so I just presume you work in Perl's native environment UNIX, and that you are using X-windows as your GUI environment. (If you happen to work in a different environment, you've wasted a lot of time, time I can't spend answering other peoples questions.)
#!/usr/bin/perl use strict; use warnings; my $pid = fork err die "Failed to fork: $!"; unless ($pid) { exec "xterm" or die "Failed to exec: $!"; } # $pid is the PID of 'xterm', but we want the PID of the shell # that's run by the xterm. # First we need to give the child time to spawn the shell. sleep 1; my $shell_pid; open my $ps => "ps -ef |" or die "Failed to open pipe: $!\n"; while (<$ps>) { my ($uid, $proc_pid, $proc_ppid) = split; if ($proc_ppid && $proc_ppid eq $pid) { $shell_pid = $proc_pid; last; } } # Open the pseudo-terminal of the shell, and print something. open my $fh => "> /proc/$shell_pid/fd/1" or die "Failed to open termin +al: $!"; print $fh "Hello!\n"; close $fh; __END__

Abigail