Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

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 scrutinizing the Monastery: (3)
As of 2016-02-06 14:41 GMT
Find Nodes?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?

    Results (231 votes), past polls