Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Pipe problem

by RhetTbull (Curate)
on Jul 18, 2001 at 22:04 UTC ( [id://97802]=note: print w/replies, xml ) Need Help??


in reply to Pipe problem

I got it to work fine on both windows (active state build 623 v5.6.0) and unix (v5.6.1). On unix, I changed the line in write_ten.pl:
open (PIPE,"| read_three.pl") or die "Can't open pipe: $!"; to open (PIPE,"| ./read_three.pl") or die "Can't open pipe: $!";
since on my system the current directory "." is not in my path. On windows I had to change it to:
open (PIPE,"| perl read_three.pl") or die "Can't open pipe: $!";
However, the output on windows is slightly different than on unix. It seems that windows doesn't recognize the broken pipe after 3 lines so I got this:
C:\temp>perl write_ten.pl Writing line 1 Read_three got: This is line number 1 Writing line 2 Read_three got: This is line number 2 Writing line 3 Read_three got: This is line number 3 Writing line 4 Writing line 5 Writing line 6 Writing line 7 Writing line 8 Writing line 9 Writing line 10 Wrote 3 lines of text
So, as Cubes stated above, make sure the scripts are in your path or the correct path is stated explicitely in your open and on windows, use "perl file.pl" in your open as stated above by runrig.

Hope this helps,
RT

Log In?
Username:
Password:

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

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

    No recent polls found