Path: utzoo!attcan!uunet!aplcen!uakari.primate.wisc.edu!uflorida!stat!sun13!sun8.scri.fsu.edu!nall From: nall@sun8.scri.fsu.edu (John Nall) Newsgroups: comp.lang.perl Subject: Misuse? Or a bug? Message-ID: <163@sun13.scri.fsu.edu> Date: 28 Jun 90 13:51:52 GMT Sender: news@sun13.scri.fsu.edu Reply-To: nall@sun8.scri.fsu.edu (John Nall) Organization: Supercomputer Computations Research Institute Lines: 26 The following script: #!/bin/perl if ($_ = <>) { print ; } will allow one to enter a line of data, and then print it out. Which is what it is supposed to do. However, the following script: #!/bin/perl if (<>) { print ; } will allow one to enter a line of data, and then exits without ever printing it out. (This is, of course, a simplified example). I thought that $_ was the default, so the two should be equivalent. Am I doing something wrong? Or is it a bug? (Obviously, it is easy to workaround, so I'm more concerned with whether or not I am misunderstanding the manual than anything else). -- John W. Nall | Supercomputation Computations Research Institute nall@sun8.scri.fsu.edu | Florida State University, Tallahassee, FL 32306 "They said it couldn't be done/they said nobody could do it/ But he tried the thing that couldn't be done!/He tried - and he couldn't do it"