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

Report information
The Basics
Id:
58350
Status:
rejected
Priority:
Low/Low
Queue:

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

BugTracker
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.


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.