title: Why does STDIN cause my Perl program to freeze?
body: <p>I am learning Perl and wrote this script to practice using STDIN. When I run the script, it only shows the first print statement on the console. No matter what I type in, including new lines, the console doesn't show the next print statement. (I'm using ActivePerl on a Windows machine.) It looks like this:</p>
  
  <pre>$perl script.pl
  <b>What is the exchange rate?</b> 90.45
  [Cursor stays here]</pre>
  
  <p>This is my script:</p>
  
  <pre><code>#!/user/bin/perl
  use warnings; use strict;
  
  print "What is the exchange rate? ";
  my @exchangeRate = &lt;STDIN&gt;;
  chomp(@exchangeRate);
  
  print "What is the value you would like to convert? ";
  chomp(my @otherCurrency = &lt;STDIN&gt;);
  
  my @result = @otherCurrency / @exchangeRate;
  print "The result is @{result}.\n";
  </code></pre>
  
  <p>One potential solution I noticed while researching my problem is that I could include <pre>use IO::Handle;</pre> and <pre>flush STDIN; flush STDOUT;</pre> in my script. These lines did not solve my problem, though.</p>
  
  <p>What should I do to have STDIN behave normally? If this is normal behavior, what am I missing?</p>