You need to do some reading on Event-driven programming and the Reactor pattern. POE is more like a state machine, with the flow of control not defined by the linear layout of code in your source; rather the sequence of external events drives what callbacks are triggered as they happen. Things happen, and when they do POE looks to see who asked to be told when that particular thing occurs. It then makes a callback to the registered routine (the handler for that event) which runs and returns control back to POE's main loop. If you've ever done any programming with an event-driven GUI toolkit that's the mindset you want to get into.

You're not in (direct) control of what happens when, the run loop is; you're responsible for telling POE what you're interested in and then let it call you back when it does. In your particular case you send the who request to start with (which causes POE to send an event to another object). When the results of that come back and are ready (because POE's told the IRC component there's been network traffic events and its handlers for those events have parsed out the who reply), that component asks POE to send you an event with the result of your initial event. You'd then do your processing of the returned results in the handler for the irc_352 event.

The cake is a lie.
The cake is a lie.
The cake is a lie.


In reply to Re: POE::IRC, Where was that tall building again? by Fletch
in thread POE::IRC, Where was that tall building again? by novastorm0

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.