Skip Menu |

This queue is for tickets about the Bot-BasicBot CPAN distribution.

Report information
The Basics
Id: 58350
Status: rejected
Priority: 0/
Queue: Bot-BasicBot

People
Owner: Nobody in particular
Requestors: phire123418 [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.81
Fixed in: (no value)



Subject: forkit function is broken
The forkit function doesn't seem print data to the channel.
Subject: forky.pl
package SayForkTest; use strict; use warnings; use base qw(Bot::BasicBot); my $b=SayForkTest->new( server=>'localhost', port=>1234, nick=>'Test', channels=>'#test' ); $b->run(); sub connected { my $self=shift; print "We're in the connected sub!\n"; $self->forkit(run=>\&to_fork, arguments=>['arg1', 'arg2']); } sub to_fork { my $self=shift; foreach (@_){ print $_."\n"; } return 'Returned from to_fork!'; }
You are using forkit() incorrectly. First of all, you're calling it from connected(), which happens before any channels are joined. Second, you didn't specify a place where the messages should be delivered. If you change "sub connected" to "sub chanjoin" and add a "channel => '#test'" parameter to the forkit() call, then it works.