POE-Component-IRC & whois

O

oneofthem

Hello,

I am trying to use the irc_whois event to see if a nick is identified to
services.

The manual states:
irc_whois
Sent in response to a 'whois' query. ARG0 is a hashref, with the following keys: <cut>

I am trying to do it this way:

sub on_whois{
my ( $kernel, %myhash) = @_[KERNEL, ARG0];
my $nick = $myhash{'nick'};
my $ident = $myhash{'identified'};

print $nick.' - ident state is:'.$ident;
}

But it seems that $nick and $ident are empty.

Can somebody help me do it the right way?

Thanks :)
 
D

DJ Stunks

oneofthem said:
Hello,

I am trying to use the irc_whois event to see if a nick is identified to
services.

The manual states:

note: hashref :)
I am trying to do it this way:

sub on_whois{
my ( $kernel, %myhash) = @_[KERNEL, ARG0];

$_[ARG0] is a hash reference, not a hash.

try this instead:

my ($kernel,$hashref) = @_[ KERNEL,ARG0 ];
my $nick = $myhash{'nick'};
my $ident = $myhash{'identified'};

now these need to use the reference, not the hash:

my ($nick, $ident) = @{ $hashref }{ qw[nick identified] };

try that.

-jp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
474,202
Messages
2,571,057
Members
47,661
Latest member
FloridaHan

Latest Threads

Top