use Net::Telnet (); $host = "x.x.x.x"; $username = "xxx"; $passwd = "xxxxxxx"; $t = new Net::Telnet (Timeout => 10, Dump_Log => "dump.txt", Input_Log => "in.txt", Output_Log => "out.txt", Prompt => '/$/'); $t->open($host); $t->login($username, $passwd); print $t->getline(); $t->waitfor('/Select Option : ?$/i'); $t->print("1");