How do I correctly shutdown a Bot::BasicBot bot (based on POE::Component::IRC)?
问题 This is a sample script. When I hit Ctrl+C, the bot quits IRC but it reconnects back after some time. How do I shut down the bot correctly? #!/usr/bin/perl package main; my $bot = Perlbot->new (server => 'irc.dal.net'); $SIG{'INT'} = 'Handler'; $SIG{'TERM'} = 'Handler'; sub Handler { print "\nShutting down bot...\n"; $bot->shutdown('Killed.'); }; $bot->run; package Perlbot; use base qw(Bot::BasicBot); sub connected { my $self = shift; $self->join('#codetestchan'); } 回答1: I've taken over