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"

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
    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.