Irrelevant has asked for the wisdom of the Perl Monks concerning the following question:
O monks greater than I,
Is there a standard utility that sends its STDIN to /dev/tty and sends /dev/tty to its STDOUT)?
To clarify my meaning; the following perl script does the job:
#!/usr/bin/perl use strict; if (my $pid = fork) { open TTY, "</dev/tty" or die $!; print while <TTY>; waitpid $pid, 0; } else { open TTY, ">/dev/tty" or die $!; select TTY; print while <>; }
I hope to find such a utility to give to the "command" parameter of IPC::Open2::open2, for debugging purposes.
Thanks,
~ Irrelevant
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: dancing with /dev/tty (two pumps)
by tye (Sage) on Mar 07, 2007 at 21:28 UTC | |
by Irrelevant (Sexton) on Mar 08, 2007 at 02:52 UTC | |
|
Re: dancing with /dev/tty
by Moron (Curate) on Mar 07, 2007 at 21:28 UTC | |
by Irrelevant (Sexton) on Mar 08, 2007 at 02:48 UTC |