I study Perl and wrote this script for practice using STDIN. When I run the script, it only displays the first print statement on the console. No matter what I type, including newlines, the console does not display the next print statement. (I am using ActivePerl on a Windows machine.) It looks like this:
$ perl script.pl
What is the exchange rate? 90.45
[Cursor stays here]
This is my script:
One of the possible solutions that I noticed while researching my problem is to enable
use IO :: Handle;
and
flush STDIN; flush STDOUT;
in my script. However, these lines did not help solve my problem.
What to do if STDIN behaves normally? If this is normal behavior, what am I missing?
perl stdin activeperl
Kevin
source share