hey everyone,my first post here.
i'm new to Perl , i am trying to write a very simple chat server,which will take each client's message and send it back to all other clients,but i'm unable to send the message to other clients,anyway this is my code.any help would be appreciated
use strict; 
use IO::Socket; 
my $c=0; 
my @arr; 
sub h { 
while(waitpid(-1,WNOHANG)>0) {} 
print "server terminated\n"; 
exit 0; 
my $svr=IO::Socket::INET->new(LocalPort=>'12345',Listen=>20,Proto=>'tcp',Reuse=>1) or die 'Cant create Socket'; 
my $clnt; 
while(1) { 
next unless $clnt=$svr->accept; 
my $child=fork(); 
my $ip=$clnt->peerhost(); 
my $port=$clnt->peerport(); 
print "Connection Aceepted $ip:$port\n"; 
if($child==0) { 
exit 0; 
print "$ip:$port Left \n"; 
sub wc { 
my $clnt=shift; 
my $msg="$c users(s) online\n"; 
print $clnt $msg; 
sub rcv { 
my $ip=$clnt->peerhost(); 
my $port=$clnt->peerport(); 
my $c=shift; 
while(my $msgin=<$c>) { 
print "$ip:$port => $msgin \n";}