#!/usr/bin/perl use Net::Telnet::Cisco; my $session = Net::Telnet::Cisco->new(Host => '172.18.56.3'); $session->login('', 'aryaka'); # Execute a command my @output = $session->cmd('show line '); print @output; # Enable mode if ($session->enable("aryaka") ) { my @output1 = $session->cmd('show ver '); print @output1; my @command = $session->cmd('clear line 3 '); $session->prompt("/[Confirm]/"); $session->print("\n"); my @command = $session->cmd('device3'); #$session->always_waitfor_prompt; $session->print("\n"); $session->print("\n"); my @output3 = 'ifconfig' ; print "ifconfig: @output3\n"; } else { warn "Can't enable: " . $session->errmsg; } $session->close;