in reply to PerlMonks MUD in progress

I still don't understand your problems with telnet clients. Communicating with them is in no way hopeless, or even that difficult (IMO). Telnet clients talk the telnet protocol, if you want to talk to them you need to at least know how to ignore the specfic bits of that protocol. (Which is what my mud does currently, will get around to actually using it sometime.) It's like trying to get information from a web server, and not talking HTTP.. Crazy ;)

Here's how I ignore the telnet protocol:

sub ignore_options { # remove all telnet options from incoming text # Parameter: Text my ($text) = @_; my $chIAC = chr(255); my $chDONT = chr(254); my $chDO = chr(253); my $chWONT = chr(252); my $chWILL = chr(251); my $chSB = chr(250); my $chSE = chr(240); my $chSEND = chr(1); my $chIS = chr(0); my $chEOR = chr(239); my $pos = -1; while(($pos = index($text, $chIAC, $pos)) > -1) { my $nextchar = substr($text, $pos + 1, 1); if(!length($nextchar)) { last; } if($nextchar eq $chIAC) { substr($text, $pos, 1) = ''; $pos++; } elsif($nextchar =~ /($chDONT|$chDO|$chWONT|$chWILL)/) { substr($text, $pos, 3) = ''; } elsif($nextchar eq $chSB) { my $endpos = index($text, $chSE, $pos); substr($text, $pos, $endpos - $pos + 1) = ''; } elsif($nextchar eq $chEOR) { substr($text, $pos, 2) = ''; } else { substr($text, $pos, 2) = ''; } } return $text; }
Still, reinvent a few wheels if you want to..

C.