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

Owner: Nobody in particular
Requestors: phire123418 [...]

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.
text/x-perl 445b
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!'; }
Download (untitled) / with headers
text/plain 333b
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 is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to