#!/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 = ; 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 = ; $telnet->print($name); @output = $telnet->waitfor('/>$/i'); print @output,"\n"; }