Because read() is almost just a buffered sysread() (perldoc -f read):

read FILEHANDLE,SCALAR,LENGTH,OFFSET
read FILEHANDLE,SCALAR,LENGTH
        Attempts to read LENGTH bytes of data into variable SCALAR from
        the specified FILEHANDLE. Returns the number of bytes actually
        read, "0" at end of file, or undef if there was an error. SCALAR
        will be grown or shrunk to the length actually read. If SCALAR
        needs growing, the new bytes will be zero bytes. An OFFSET may
        be specified to place the read data into some other place in
        SCALAR than the beginning. The call is actually implemented in
        terms of stdio's fread(3) call. To get a true read(2) system
        call, see "sysread".

and write() is absolutely nothing like syswrite(). It's used for printing formats (perldoc -f write):

write FILEHANDLE
write EXPR
write   Writes a formatted record (possibly multi-line) to the specified
        FILEHANDLE, using the format associated with that file. By
        default the format for a file is the one having the same name as
        the filehandle, but the format for the current output channel
        (see the "select" function) may be set explicitly by assigning
        the name of the format to the "$~" variable.

        Top of form processing is handled automatically: if there is
        insufficient room on the current page for the formatted record,
        the page is advanced by writing a form feed, a special
        top-of-page format is used to format the new page header, and
        then the record is written. By default the top-of-page format is
        the name of the filehandle with "_TOP" appended, but it may be
        dynamically set to the format of your choice by assigning the
        name to the "$^" variable while the filehandle is selected. The
        number of lines remaining on the current page is in variable
        "$-", which can be set to "0" to force a new page.

        If FILEHANDLE is unspecified, output goes to the current default
        output channel, which starts out as STDOUT but may be changed by
        the "select" operator. If the FILEHANDLE is an EXPR, then the
        expression is evaluated and the resulting string is used to look
        up the name of the FILEHANDLE at run time. For more on formats,
        see the perlform manpage.

        Note that write is *not* the opposite of "read". Unfortunately.

And regardless, write() too uses Perl's stdio buffering, which means even if it did what its name implies, it couldn't be used for robust network IO.


In reply to Re: Re: Perl + Unicode == Networking Woes by William G. Davis
in thread Perl + Unicode == Networking Woes by William G. Davis

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.