I KNOW this is not an Emacs bug. Eli Zaretskii suggested I report it as one.
I never invoke a Perl program with a line like
Rather I go into the Perl directory and type the name of the program. The program I run in a DOS window are exactly the same one I run in Emacs shell.
use 5.012;
use strict;
#$|=1;
my $line = <STDIN>;
print "\$line = $line\n";
In a DOS window it runs like this:
1234
$line = 1234
C:\Perl>
Note in DOS I type in the line 1234, and the program prints "$line = 1234".
In Emacs shell mode it runs like this:
In Emacs the program doesn't pause to wait for a keyboard input. It blows right through it and then prints "$line = ".
The -w switch is not involved.