Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Piped input read by Windows Vista but not by Windows XP

by kcott (Archbishop)
on Nov 01, 2010 at 23:29 UTC ( [id://868894]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://868894]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2024-04-20 00:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found