HI, I have visited many chatrooms on a specified port(such as 8000).But I have never seen their source codes. Recently,I want to build my chatroom like them with Perl. I can code Socket with Perl and kown some about HTTP.My idea is:accept requests and save these Sockets in a Handles -Hash.When sb. want to say to others,I print his saying to every handles in the Handles-Hash.I set $SIG{PIPE}='IGNORE' ,so that when "print SOCKET" return false or undef I can say the user has gone and delete the user in User-Hash. I have no experience on this matter.Is my idea wrong? I hope I can get some advices from you. Many Thanks.

In reply to My simple idea. by iic

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.