in reply to Piped input read by Windows Vista but not by Windows XP
While I can't give you an answer as to why, I can confirm this behaviour. I first tried your code on cygwin: pipe worked fine. Then tried with XP (using same code and running from the same directory): got the same as you. Furthermore, taking the input from stdin rather than pipe worked fine.
Here's my tests:
ken@Miranda ~/c/_/tmp $ cat > xp_pipe_prob.pl #!perl use strict; use warnings; while (<>) { chomp; s/:/ /; print "$_\n"; } ken@Miranda ~/c/_/tmp $ echo 'fred:derf' fred:derf ken@Miranda ~/c/_/tmp $ chmod +x xp_pipe_prob.pl ken@Miranda ~/c/_/tmp $ echo 'fred:derf' | xp_pipe_prob.pl fred derf ken@Miranda ~/c/_/tmp $ Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\_\tmp>echo 'fred:derf' 'fred:derf' C:\_\tmp>echo 'fred:derf' | xp_pipe_prob.pl C:\_\tmp>echo 'fred:derf' | perl xp_pipe_prob.pl 'fred derf' C:\_\tmp>xp_pipe_prob.pl fred:derf fred derf C:\_\tmp>
-- Ken
|
|---|