Can someone explain the difference between calling a perl script via file association versus calling the same script explicitly via perl.exe
?
Apparentl
It looks like it was a known bug in Windows 2000: STDIN/STDOUT Redirection May Not Work If Started from a File Association.
I get the same behaviour you describe with Strawberry Perl on WinXP, however once I created the registry entry described in the above article (even though the reg entry is targetted at Win2K), stdin
works as expected.
For completeness, in case the link above goes away, the reg entry it suggests creating is:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
InheritConsoleHandles
REG_DWORD
Decimal
1
Edit: I ought to add that even though the KB article claims it was fixed in XP SP1, I've got XP SP3 installed. So whether MS have broken this, or never fixed it completely, I can't say!