I don't see what the problem is. This may be because it is in the code you haven't posted. But I have some suggestions and questions you might think about, that might help you narrow down where the problem is.

It may help you to use strict and warnings, and use lexically scoped variables (my) where possible. It is a good habit to get into even if it doesn't help here.

You could check your inputs from the socket and from your getGrpMembers() subroutine to ensure they contain only valid characters.

Is the WEIRD instance of $grp a value read from the client or one returned from getGrpMembers() in a previous iteration of your loop?

Does $buf, as read from the socket, have reasonable content?

Do any of the values returned by getGrpMembers begin with WEIRD stuff, followed by '~' and with "Group" anywhere in the string?


In reply to Re: IO::Socket and passed variables to functions by ig
in thread IO::Socket and passed variables to functions by onegative

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.