Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: No interactivity (prompt) after reading from pipe

by larryk (Friar)
on Nov 18, 2005 at 14:32 UTC ( #509788=note: print w/ replies, xml ) Need Help??

in reply to No interactivity (prompt) after reading from pipe

I guess it's because you're piping stuff to STDIN. That will finish with an EOF (so that your while loop can complete) and so when you get to trying to read from STDIN again for user input, perl thinks STDIN is at EOF and doesn't read any more.

Try putting this in before your <STDIN>:

eof(STDIN) and print "This ain't gonna work\n";

Question is... how do you reset the EOF on STDIN?

perl -le "s,,reverse killer,e,y,rifle,lycra,,print"

Comment on Re: No interactivity (prompt) after reading from pipe
Download Code
Replies are listed 'Best First'.
Re^2: No interactivity (prompt) after reading from pipe
by svenXY (Deacon) on Nov 18, 2005 at 14:41 UTC
    OK, that is indeed the case.
    Can I close and reopen STDIN somehow?
      Have a look at seek, pp. 779-780 in Programming Perl, 3rd edition.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://509788]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2015-11-30 05:27 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (758 votes), past polls