sub register { shift->register_hook("quit", "quit_handler"); } sub quit_handler { my $qp = shift->qp; my @fortune = `/usr/games/fortune -s`; @fortune = map { chop; s/^/ \/ /; $_ } @fortune; $qp->respond(221, $qp->config('me') . " closing connection.", @fortune); return DONE; }