No such thing as a small change | |
PerlMonks |
Re: No interactivity (prompt) after reading from pipeby fizbin (Chaplain) |
on Nov 18, 2005 at 15:08 UTC ( [id://509819]=note: print w/replies, xml ) | Need Help?? |
What everyone else has said so far is right - if you are reading from a pipe, then you cannot simply read from standard input again to read from the terminal. However, this does not mean that all is lost. On many POSIX systems, you can find the name of the controlling terminal with POSIX::ctermid(); and then open and read from that.
Yes, I could have used STDIN there the second time, but I didn't so as to keep it clear where you were reading what from.
--
In Section
Seekers of Perl Wisdom
|
|