foreach $host ( @hosts ) { my $conn = Net::Telnet::Cisco->new(HOST => $host, Dump_log => 'dump2.log',Timeout=>20, ErrMode => 'return'); if ($conn -> waitfor ('/Password:.*/')){ $conn->login( Passcode => $passw); } else { $conn->login( Name => $username, Password => $password) or die "ERROOOOR"; } print $conn->cmd("show int status"); $conn->close; }; #### < 0x00000: ff fb 01 ff fb 03 ff fd 18 ff fd 1f 0d 0a 0d 0a ÿû.ÿû.ÿý.ÿý..... < 0x00010: 55 73 65 72 20 41 63 63 65 73 73 20 56 65 72 69 User Access Veri < 0x00020: 66 69 63 61 74 69 6f 6e 0d 0a 0d 0a 50 61 73 73 fication....Pass < 0x00030: 77 6f 72 64 3a 20 word: > 0x00000: ff fd 01 ff fd 03 ff fc 18 ff fc 1f ÿý.ÿý.ÿü.ÿü. < 0x00000: ff fe 18 ff fe 1f ÿþ.ÿþ. > 0x00000: 73 68 6f 77 20 69 6e 74 20 73 74 61 74 75 73 0d show int status. > 0x00010: 0a . < 0x00000: 0d 0a 50 61 73 73 77 6f 72 64 3a 20 ..Password: