I don't believe that is the problem. If Perl gets partial data from a socket and that partial data doesn't contain the current value of $/, then <STDIN> is going to issue another read until it either gets a string that contains the current value of $/ or it gets end-of-file. (Well, that is my impression and testing confirms it but the perl source code involved is quite complex with lots of possible routes through the code depending on #ifdefs and big ifs, so there may be some cases where this doesn't happen -- if so, I'd appreciate validation of this fact.)

But, in general, this feature usually ends up being a good reason to not use <SOCK> to read from sockets. Certainly, if you do use <SOCK> to read from sockets, be sure to have $/ set appropriately.

For this case, I would think that "appropriately" would mean having $/ set to undef so that <STDIN> reads until end-of-file. But that strategy won't work unless the client requests that end-of-file be sent by using shutdown. But then, if the client doesn't use shutdown than the server has no reliable way to determine when all of the data has been received and it would have to resort to some sort of timeout logic.

evilstevel, feel free to provide more details if our guessing hasn't helped yet. (:

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

In reply to (tye)Re: Server script through inetd by tye
in thread Server script through inetd by evilstevel

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.