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