Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!tut.cis.ohio-state.edu!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!sdd.hp.com!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: STDIN waits for ^D, not newline Message-ID: <8044@jpl-devvax.JPL.NASA.GOV> Date: 9 May 90 23:12:29 GMT References: <5249@crltrx.crl.dec.com> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 28 In article <5249@crltrx.crl.dec.com> halbert@crl.dec.com writes: : 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. This is because local is really just a modifier on a list lvalue, so you're really doing the same as the following: local($a); ($a) = ; Since ($a) is a list, the is being evaluated in an array context, and returning the entire file. You could force a scalar context by concatenating a null string, but it's probably more efficient to separate it out thusly: local($a); $a = ; Larry