i want to make a chat client: SERVER -> jdkchat server (is a small c++ code that create a telnet server) So now i need a client from the http site.... ... i'm not an hard programmer and i have some problems with c... so i try this
#!/usr/bin/perl use Net::Telnet; $telnet = new Net::Telnet ( Timeout=>10, Errmode=>'die', Port=>2001, Prompt => '/bash\$ $/' ); $telnet->open('localhost'); @welcome = $telnet->waitfor('/Your Name:$/i'); print @welcome; $name = <STDIN>; chomp $name; $telnet->print($name); $telnet->waitfor('/>$/i'); $telnet->print('ciao io sono un bot!'); $telnet->waitfor('/>$/i'); $telnet->print('ora faccio un who'); @who=$telnet->print('/who'); @output = $telnet->waitfor('/>$/i'); print @output,"\n"; unless ($parol eq 'exit') { $parol = <STDIN>; $telnet->print($name); @output = $telnet->waitfor('/>$/i'); print @output,"\n"; }