This is based on a python script I found out on the net. I have not writen a client but it works with unix telnet clients. chat.pl... #!/usr/bin/perl use IO::Socket; use IO::Select; use Userlist; # Fork off... $pid = fork(); exit if ($pid); #Turn off buffering $|++; my $quit = 0; # Handle the control-c $SIG{INT} = sub {$quit++}; my $listen = IO::Socket::INET->new( LocalPort => 8080, Listen => 20, Proto => 'tcp', Reuse => 1, Timeout => 60*60 ); $read = IO::Select->new(); $read->add($listen); while (!$quit) { my @ready = $read->can_read; foreach $selected (@ready) { if ($selected == $listen) { my $conn = $listen->accept; $ip = $conn->peerhost; # Create new object $user = Userlist->new($conn); # Get the user's name $name = $user->getName; $count = push(@users,$user); print $conn $count."-".$name."-".$ip."\n"; $read->add($conn) if $conn; } else { # Get input from who's ready $buffer = <$selected>; # Send message to all users $user->broadcast($buffer,$selected,\@users); } } } Userlist.pm... package Userlist; sub new { $self = shift; $obj = { USER => shift, NAME => '' }; return bless $obj,$self; } sub conn { $self = shift; return $self->{USER}; } sub getName { $self = shift; $conn = $self->{USER}; print $conn "Name: "; $name = <$conn>; $name =~ s/\s+$//; $self->{NAME} = $name; return $self->{NAME}; } sub name { $self = shift; return $self->{NAME}; } # I'm not really sure if this is the best place to make this # sub, but its the only way I can think of to get the name # of the user that sent the message. sub broadcast { $self = shift; $buffer = shift; $selected = shift; $users = shift; if ($buffer) { foreach $client (@$users) { $connection = $client->conn(); $name = $self->{NAME} if ($connection == $selected); exit(0) if ($buffer =~ /quit/i); print $connection $name.": ".$buffer; } } } 1;