http://qs321.pair.com?node_id=42395


in reply to Sending commands to a Telnet Server

Are you unbuffering the right file handle? $|=1 affects the currently-selected filehandle. Be sure you're doing this:
select(MUX_OUTPUT); $|=1; select(STDOUT); print MUX_OUTPUT "this is unbuffered\n";
Though you will avert this headache by following merlyn's advice and giving Net::Telnet a try. If you prefer more control, use IO::Socket and/or Expect and set up the connection to the MUSH yourself:
my $mush = new IO::SOCKET::INET ("mush.example.com:8080") or die "Couldn't connect to MUSH: $@"; print $mush "command\n"; my $response = <$mush>;