#!/usr/bin/perl use Net::Telnet; $host = "xxx.xxx.xxx.xxx"; $port = "23"; $uid = "xxxxx"; $pwd = "xxxx"; open $inputLog, ">in.log"; $box = new Net::Telnet(); $box->open( Host => $host, Port => $port, ); $iLog = $box->input_log($inputLog); $flag = $box->login( Name => $uid, Password => $pwd, ); $box->print("show log"); $box->waitfor('/# $/i'); $box->close; exit