Monks, I have been stuck on this problem for the good majority of a week now and cannot explain it. I have developed a client/server application useful for CGI scripts that I personally wanted to run with root privileges but not directly. This has allowed me to run a server as root and install my own security checking rather than rely on something like suexec or suidperl. Anyway my trouble begins with a function that I created that listens for a "termination" message from the client before logging the conversation as a success (this also listens for "resend" messages much like TCP error-control). The function follows:
sub FinishUp { my ($clientid) = @_; my $incoming=""; while ( (sysread $clientid, $incoming, 1024) && != 0 ) { print "Received Response from $clientid: $incoming\n"; if ($incoming =~ /Resend/) { return "yes", "yes"; } if ($incoming =~ /Finished|OK/) { return "no", "no"; } } }
The strange and unexplainable part is...this works perfect for the majority of functions I call it from, however, there are 3 of the approximately 20 functions where the finishup function exits with this error message: Use of uninitialized value in integer ne (!=) at common.pl line 250. I fail to understand this because the finishup function is called the exact same way with the exact same parameters (the client ID) everytime. use strict and perl -w are outputting just that error message - everything else runs perfect. If anyone might be able to shed a little light on this I would greatly appreciate it. -Adam Stanley Nethosters, Inc.

In reply to Unexplainable Client/Server trouble by astanley

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.