On Sat, Aug 03, 2002 at 04:20:18PM +0200, Bruno Boettcher wrote:
Hello,
funny enough the given wrappers implement more or less what i already
forgrammed, and they don't seem to solve the multiserver clashing of
the POE::IRC module (at least my testscript copletely looses track
when connected to 2 servers...)
anyway the actual problem is, can retrieve from the session or the
kernel the actual channel context i am in?
The standard $_[SENDER] parameter will be a reference to the IRC
component that generated the event. You can use it as a destination
in a post() call:
$kernel-post($sender, ...);
You can also use the sender as a key in the heap. POE will eat
stringified senders as well as true references, too.
$heap-{users}{$sender}{$nick} = $userhost; # or something
It's better to work with session IDs here, though.
my $irc_id = $_[SENDER]-ID();
$heap-{users}{$irc_id}{$nick} = $userhost; # or something
They are not blessed references, so they don't confound Perl's garbage
collection (which POE relies on heavily). They are also unique,
whereas references may be reused frequently.
-- Rocco Caputo / [EMAIL PROTECTED] / poe.perl.org / poe.sf.net