Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

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?

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


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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (11)
As of 2014-09-16 07:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (157 votes), past polls