since on my system the current directory "." is not in my path. On windows I had to change it to:open (PIPE,"| read_three.pl") or die "Can't open pipe: $!"; to open (PIPE,"| ./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:open (PIPE,"| perl read_three.pl") or die "Can't open pipe: $!";
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.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
Hope this helps,
RT
In reply to Re: Pipe problem
by RhetTbull
in thread Pipe problem
by nysus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |