Well, the FAQ is misleading (*sigh*). Perl does support unbuffered I/O via syswrite and sysread. Perhaps they meant that Perl doesn't support unbuffered I/O via other functions such as print and printf (except that you can have the buffer autoflushed as described).

<Update> And the difference between unbuffered and "command buffered" (as the FAQ calls it) is pretty subtle and usually unimportant so you might as well use "command buffered" for most things. The only time that I think it matters is that you can get into trouble by mixing buffered and unbuffered I/O to/from the same file handle. Nothing external to your script should be able to tell the difference between the two. </update>

In particular, you don't have to specify a write length of 1 in order for syswrite to be unbuffered. Also, I encourage you to just leave the length argument off and write syswrite(WHOIS,$write).

By writing things one byte at a time, your data might get sent with as few as one byte per packet. I could see this confusing a poorly written server.

        - tye (but my friends call me "Tye")

In reply to (tye)Re: syswrite strange behaviour on some systems by tye
in thread syswrite strange behaviour on some systems by dash2

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.