Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!decwrl!crltrx!halbert.crl.dec.com!halbert From: halbert@halbert.crl.dec.com (Dan Halbert) Newsgroups: comp.lang.perl Subject: STDIN waits for ^D, not newline Message-ID: <5249@crltrx.crl.dec.com> Date: 8 May 90 22:40:51 GMT Sender: news@crltrx.crl.dec.com Reply-To: halbert@crl.dec.com Organization: DEC Cambridge Research Lab Lines: 32 (Using Perl version: $Header: perly.c, v 3.0.1.4 90/02/28 18:06:41 lwall Locked $ Patch level: 15) I'm writing an interactive terminal program in perl. It prompts the user and reads from STDIN. If you try this program: print "prompt: "; $a = ; print $a; then a carriage return will end the input. (That is, will read one line.) However, if you try: print "prompt: "; local ($a) = ; print $a; then STDIN keeps reading input until I type ^D. In my program, the local() is in a subroutine, of course, but that isn't necessary to reproduce the problem. Opening "-" explicitly doesn't solve the problem. I just started looking at comp.lang.perl; sorry if this is old hat. --Dan Halbert