in reply to Seeking Feedback on Chat Program (was Seeking Feed back)

One more thing - I would add -T to the shebang line. You do a few checks on the data to make sure nobody's trying to hack it, but, to quote various sources on the subject, "never trust any input from the user".

Your checks are good for what you've thought of, but there may be some things that you haven't thought of. Also, you may end up altering the code some day in such a way to make these security holes more apparent and exploitable.

MM