#!/usr/bin/perl -w use strict; use Net::Telnet; my $t = new Net::Telnet( Input_log => 'log.txt', Prompt => '/cis-.+[>#]/' ); ## Note - all my Cisco devices have hostnames beginning with "cis-" ## so hence the custom prompt setting here. $t->open('10.10.10.1'); $t->login('username1', 'password1'); $t->cmd('term length 0'); print $t->cmd('where'); ## Everything above this line works as I expect ## Things below this line seem to go a bit weird... $t->print('enable'); $t->waitfor('/Password:/'); $t->print('password1'); $t->cmd('term length 0'); print $t->cmd('where'); $t->close();