For Programmers: Free Programming Magazines  


Home > Archive > PERL Modules > November 2007 > POE::Component::IRC::State and nick changes









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author POE::Component::IRC::State and nick changes
Kurt M. Weber

2007-11-09, 6:59 pm

Using POE::Component::IRC::State, I'm trying to access channels in which my
Perl program sees a user has changed his nick. This is the relevant
subroutine:

sub onnick{
my ($who,$newnick,$where) = @_[ARG0,ARG1,ARG2];
my ($nick, $host) = split /!/, $who;
my $channel = $where->[0];

my $logline = "--- " . $nick . " is now known as " . $target;

&writeline($ircserver, $channel, $logline);
}

Now, the documentation indicates that ARG2 will contain an arrayref of all
the channels on which the client saw the user change his nickname. Now,
for simplicity's sake, I'm just worried about the first one, which should
be in $where->[0].

However, it's not there.

Using Data::Dumper, I discover that ARG2 (and therefore $where) is an
arrayref, but it's empty.

Any clue what I'm missing? And yes, I am using
POE::Component::IRC::State->spawn rather than just
POE::Component::IRC->spawn.
--
Kurt M. Weber
<kmw@armory.com>
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com