in reply to POE::IRC, Where was that tall building again?
I just had a crazy idea but if by chance I return the data I want in &on_who return $account, $channel; will that return a value to where I typed $irc->yield( who => '#poe')?From the POE docs, yield always returns true. You are simply posting a new event to the queue which POE will act on later. However, if you call call, you will be invoking another method synchronously and it will return the return value(s) of that method. But call won't work for you in this case since the who handler doesn't return the parsed who output.
The general way to handle this problem is to remember why you made the who call and then perform the tail end of the action in the on_who handler, i.e.:
# in code which calls 'who': $reason_for_calling_who = 'whatever'; $irc->yield('who'); ... # in on_who handler: if ($reason_for_calling_who eq 'whatever') { # complete processing for this case } elsif ($reason_for_calling_who eq ...) { ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: POE::IRC, Where was that tall building again?
by bingos (Vicar) on Jul 16, 2008 at 15:45 UTC | |
|
Re^2: POE::IRC, Where was that tall building again?
by novastorm0 (Beadle) on Jul 16, 2008 at 18:25 UTC |