sub on_connect { my $conn = shift; $conn->join($conn->{channel}); $conn->{connected} = 1; }