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


In reply to Re: Pipe problem by RhetTbull
in thread Pipe problem by nysus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.