in reply to Pipe problem

On windows, assuming fork and everything else works, wouldn't you have to say:"| perl read_three.pl", etc. ??

Replies are listed 'Best First'.
(tye)Re: Pipe problem
by tye (Sage) on Jul 18, 2001 at 21:55 UTC

    That is a good idea even when not on Win32. Some reasons include:

    • "." is often not in $ENV{PATH} under Unix
    • Your permissions might be wrong under Unix
    • Your file associations might be wrong under Win32
    • File associations break I/O redirection under Win32

            - tye (but my friends call me "Tye")
Re: Re: Pipe problem
by Hofmator (Curate) on Jul 18, 2001 at 21:53 UTC

    This does the trick (Win2K), the strange thing is that without the pipe you don't need to call perl explicitly - as '.pl' is associated with perl.

    And of course - Windows doesn't give a damn if the pipe is broken or not and outputs:

    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

    -- Hofmator

Re: Re: Pipe problem
by nysus (Parson) on Jul 18, 2001 at 21:52 UTC
    OK, tried that, but I still don't get what Stein says I should get. Also, any idea on why Linux doesn't work? Here's what I get on Windows 98 with your suggestion:
    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

    $PM = "Perl Monk's";
    $MCF = "Most Clueless Friar Abbot Bishop";
    $nysus = $PM . $MCF;
    Click here if you love Perl Monks