Well, the fork() call is as well supported as dd and gzip :) (ie, not). If I read your example correctly, you seem to want to read a disk (in raw or character mode), gzip it and send it somewhere using something along the lines of netcat.

My first suggestion would be to write a few more lines of code and implement the whole thing in perl, which would allow you to run your task anywhere, without the overhead of multiple processes. Take a look at IO::Zlib and IO::Socket, which would do all the work for you.

Also note that in Win32, pipelines used to be very inefficient. The whole output of each member of the pipeline is executed up to completion and its output sent to a temporary file. Then the next member is fed with the temporary file and its output treated in a similar way, untill all the members have run. I would not be surprised if this were the case even today.

Regards.


In reply to Re: forking pipe open by fokat
in thread forking pipe open by Anonymous Monk

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.