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:
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:select(MUX_OUTPUT); $|=1; select(STDOUT); print MUX_OUTPUT "this is unbuffered\n";
my $mush = new IO::SOCKET::INET ("mush.example.com:8080") or die "Couldn't connect to MUSH: $@"; print $mush "command\n"; my $response = <$mush>;
|
---|
In Section
Seekers of Perl Wisdom