. . . # My box o' global connections my @cnx; . . . $server->establish($fh)->cb( sub { my $connection = eval { shift->recv }; # Add new connection to the box push @cnx, $connection; # Remove connection when it closes $connection->on(finish => sub { @cnx = grep { $_ ne $connection } @cnx; } . . . } ); . . . sub send_global_message { my $msg = shift; for my $c (@cnx) { $c->send($msg); } }