Assuming you don't have $/ set, the problem may be that perl is receiving a partial line from the read or recv it uses. Recall that even though it looks like a read from a keyboard, it is reading from a socket. The TCP protocol does not necessarily deliver data in the chunks (e.g. lines) in which it was sent. There are no data boundries in TCP (use UDP for that). While the camel book examples just use
while($line = <SOCK>)
to read, they read small messages.

In general, when you read from a TCP socket you need to be sure you got a whole message (a line in your case) and continue reading until you can verify that you got the whole message.

You can test with something like this:

$| = 1; # remove buffering while($input = <STDIN>){ # maybe process the input print $input; }
--traveler </code>

In reply to Re: Server script through inetd by traveler
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.