#!/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; #### C:\Users\rpatel\Desktop\Perl>perl Login.pl "my" variable @command masks earlier declaration in same scope at Login.pl line 24. Tty Typ Tx/Rx A Modem Roty AccO AccI Uses Noise Overruns Int 0 CTY - - - - - 0 0 0/0 - 1 TTY 115200/115200- - - - - 17 34 461/1381 - 2 TTY 115200/115200- - - - - 8 57 402/1198 - 3 TTY 115200/115200- - - - - 25 31 141/412 - 4 TTY 115200/115200- - - - - 14 14 17/51 - 5 TTY 115200/115200- - - - - 7 0 0/0 - * 6 TTY 115200/115200- - - - - 2 0 0/0 - 7 TTY 115200/115200- - - - - 6 8 529/1613 - 8 TTY 9600/9600 - - - - - 5 1196 2744/12 - 9 TTY 115200/115200- - - - - 9 14 24/68 - 10 TTY 115200/115200- - - - - 5 5 592/1768 - 11 TTY 115200/115200- - - - - 5 0 0/0 - 12 TTY 115200/115200- - - - - 0 2 8/23 - * 13 TTY 9600/9600 - - - - - 4 33 8352/25150 - 14 TTY 115200/115200- - - - - 5 1 44/133 - 15 TTY 115200/115200- - - - - 2 0 0/0 - 16 TTY 19200/19200 F - - - - 2 0 0/0 - 17 AUX 9600/9600 - - - - - 0 0 0/0 - * 18 VTY - - - - - 17 0 0/0 - * 19 VTY - - - - - 132 0 0/0 - * 20 VTY - - - - - 56 0 0/0 - 21 VTY - - - - - 19 0 0/0 - Tty Typ Tx/Rx A Modem Roty AccO AccI Uses Noise Overruns Int 22 VTY - - - - - 17 0 0/0 - Cisco Internetwork Operating System Software IOS (tm) 2500 Software (C2500-I-L), Version 12.0(5)T, RELEASE SOFTWARE (fc1) Copyright (c) 1986-1999 by cisco Systems, Inc. Compiled Fri 23-Jul-99 03:14 by kpma Image text-base: 0x03039754, data-base: 0x00001000 ROM: System Bootstrap, Version 11.0(10c)XB1, PLATFORM SPECIFIC RELEASE SOFTWARE (fc1) BOOTFLASH: 3000 Bootstrap Software (IGS-BOOT-R), Version 11.0(10c)XB1, PLATFORM SPECIFIC RELEASE SOFTWARE (fc1) ANAP-stack-Term-Server uptime is 3 weeks, 2 days, 20 hours, 34 minutes System returned to ROM by power-on System image file is "flash:c2500-i-l.120-5.T" cisco AS2511-RJ (68030) processor (revision K) with 2048K/2048K bytes of memory Processor board ID 21339790, with hardware revision 00000000 Bridging software. X.25 software, Version 3.0.0. 1 Ethernet/IEEE 802.3 interface(s) 1 Serial network interface(s) 16 terminal line(s) 32K bytes of non-volatile configuration memory. 8192K bytes of processor board System flash (Read ONLY) Configuration register is 0x2102 command timed-out at Login.pl line 20