It's not terribly difficult, depending on what you want to do. If you're just running a program and are content to process the STDOUT information after the program finishes, you can get an array of all the lines like this:
my @text = `command to run`;
This will run the command, collect the STDOUT data and put it into @text, where you can do with it what you want. In this scheme, your perl script needs to run the command. If you'd rather not have perl run the command, you can do something like this:
command to run | perl script_to_process_STDOUT.pl
Here you're just telling the shell to run a command and feed its STDOUT to the input stream of the next program. Then your script would read the data as if it were being typed by hand.
You can review the modules IPC::Cmd, IPC/Open2 and IPC/Open3 on CPAN for other ways to do it. If you look around there, you'll likely find a few others, too.
Update: It seems I missed the last paragraph of your message. Perhaps tcpsnoop might be able to help. The ttysnoop.c client looks like it would be easy enough to modify to start a perl script and feed it the data from the other TTY. I don't know if it'll run on Solaris or not, but I don't see any obvious blockers.
...roboticus
When your only tool is a hammer, all problems look like your thumb.
In reply to Re: Can Perl read another terminals STDOUT?
by roboticus
in thread Can Perl read another terminals STDOUT?
by westrock2000
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |