sub stream1 { my ($lstream1) = @_; #socket data comes in on my $buf1; #buffer receiving stream if($lstream1->connected) { while(defined($buf1=<$lstream1>)) { #PROBLEM foreach my $fn (@stream1_clients) { #all connected clients open my $fh, ">&=$fn" or warn $! and die; #open socket to client binmode($fh, ":raw"); #thought this solved win/unix problems print $fh $buf1; } $|++ } } my $stream_ip = $lstream1->peerhost; print "* Stream 1 [$stream_ip:$stream1_prt] disconnected\n"; close($lstream1); }