Heh, fight the good fight brother.. ;)

Seriously though. I too was fairly overwhelmed by the initial docs. Until you really grok what is available with POE it all seems so daunting. The way I got over it was I grabbed a perl based mud from sourceforge (I believe its called poe-mud, or some such), and hit http://poe.perl.org. On the poe site there is a simple chat server that I used as my base, and I have been extending since. If memory serves this is all it takes to get a full fledged TCP based server up and functional. ready?
#!/usr/bin/perl use strict; use POE qw( Component::Server::TCP ); POE::Component::Server::TCP->new( Alias => "MUD", Port => '30000', InlineStates => { 'send' => \&handle_send, }, ClientError => \&c_error, ClientInput => \&c_input, ClientConnected => \&c_connect, ClientDisconnected => \&c_disconnect, ); $poe_kernel->run();
So the server has predefined events, when those events happen the routines referenced on the right are called.

In regards to the heap, as far as I have been able to understand it the heap is just that. A session's very own memory space. So that in sub_A you could set $heap->{some_key} = 1, and in sub_B do if ( $heap->{some_key}). The heap is there to get around shared memory issues I think.

At any rate, stick with POE. I know its disconcerting, but the beauty and power of those modules are simply breathtaking for me. At some point I do believe I will be helping that project out, as it is so useful.

Spend time reading POE::Kernel, and POE::Session. Once you really grok those 2 modules, then the rest just kind of falls into place. Also grab something written using POE and pull it apart, play with it, and make something slightly different. At some point the light will come on, and you will probably say "Holy @(#$, thats all it takes to do that?!?"

Update: altered poe.perl.com -> poe.perl.org :P

MMMMM... Chocolaty Perl Goodness.....

In reply to Re: Re: PerlMonks MUD in progress by l2kashe
in thread PerlMonks MUD in progress by Coruscate

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.