in reply to Multiple STDIN sources
Alternatively, you can actually read from STDERR, just as you might print status or error messges to STDERR. If your reading inout from stdin, you might want to be able to write output to stdout too, rather than having your prompts go to stdout. You can print your prompts to STDERR or open the tty read/write "+</dev/tty".while (<>) { $stream .= $_; } open TTY, "</dev/tty"; print "Do you want to process the stream?"; my $ans = <TTY>;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Multiple STDIN sources
by perlfan (Parson) on Mar 10, 2004 at 14:27 UTC | |
by dada (Chaplain) on Mar 10, 2004 at 15:03 UTC |