title: Terminating while loop with empty stdin in Perl
body: <p>I'm running a <code>while</code> loop in a Perl script that needs to terminate when nothing is entered for <code>stdin</code>. I've tried all kinds of possibilities, most recently <code>while($in ne "")</code>, but nothing works. What is the correct way to terminate a while loop if the given condition (stdin) is simply nothing (just enter is pressed at the prompt)?</p>
  
  <p><strong>EDIT:</strong> To clarify, I need a loop similar to the below code, and I need to terminate the while loop if nothing is entered for the prompt.</p>
  
  <pre><code>print "Enter your information: ";
  $in = &lt;&gt;;
  
  while($in) {
      #do stuff
  
      print "Enter your information: ";
      $in = &lt;&gt;;
  }
  </code></pre>