my $client; while ( $client = $server->accept() ) { ... writeClient("I'm trying to do something, really!"); } ... sub writeClient { ### Read args, take first arg and use it, dump the rest my ( $message, @junk ) = @_; my $clientMessage = "$message\r\n"; print $client $clientMessage; }