#!/usr/bin/perl -w # use warnings; use diagnostics; use warnings; use strict; use Term::ANSIScreen qw(cls); our @switches; our $clear_screen = cls(); # Subroutine vars our $slotcount = 1; ###################### START of MENU 1 / MODEL SELECT ################### while (my $modelselect ne '10') { print $clear_screen; print "#####################################################################\n"; print "## Configuration Script for Catalyst Access Switches IOS 15.x ##\n"; print "#####################################################################\n"; print "## ##\n"; print "##  Select Model of Switch: ##\n"; print "## (1) - Cat6509 (2) - Cat6506 (3) - Cat6513 ##\n"; print "## (2) - Cat4507 (5) - Cat4506 (6) - Cat4510 ##\n"; print "## (7) - WS-C3850-24 (8) - Cat3850-48 (9) - Cat3850 Stack ##\n"; print "## (10) - Exit ##\n"; print "## ##\n"; print "#####################################################################\n"; print "Please enter your selection:\n"; $modelselect = ; chomp $modelselect; if ($modelselect eq 1) { print "You have selected $modelselect\n"; my $slotlimit = 9; print "You have selected a 'WS-C6509'.\n"; print "$slotlimit lincecard slots have to be configured:\n"; while ($slotcount <= $slotlimit) { print "Calling Subroutine 'Slotmenu' with value $slotcount\n"; &slotmenu($slotcount); push (@switches, my $portcount); $slotcount++; } } if ($modelselect eq 2) { print "You have selected $modelselect\n"; my $slotlimit = 6; print "You have selected a 'WS-C6506'.\n"; print "$slotlimit lincecard slots have to be configured:\n"; while ($slotcount <= $slotlimit) { print "Calling Subroutine 'Slotmenu' with value $slotcount\n"; &slotmenu($slotcount); push (@switches, my $portcount); $slotcount++; } } print "@switches\n"; sub slotmenu { print $clear_screen; print "Value actually passed to Subroutine 'Slotmenu': $slotcount\n"; print "#####################################################################\n"; print "## Configuration Script for Catalyst Access Switches IOS 15.x ##\n"; print "#####################################################################\n"; print "## ##\n"; print "## Configure Slot $slotcount: ##\n"; print "## Select port count, speed, or other layout ##\n"; print "## ##\n"; print "## 1000 Mbit/s = (A) 10000 Mbit/s = (B) ##\n"; print "## 24 X Blade = (1) 48 x Blade = (2) ##\n"; print "## Supervisor = (S) ##\n"; print "## No linecard = (0) ##\n"; print "## ##\n"; print "## 'Enter as: A2 for 48 x 1000 Mbit lincecard ##\n"; print "## ##\n"; print "#####################################################################\n"; print "Please enter number ports on linecard:\n"; my $portcount = ; chomp $portcount; #return $portcount; push (@switches, $portcount) } } #### Use of uninitialized value $switches[1] in join or string at morecurrent.pl line 69, line 11 (#1) Use of uninitialized value $switches[3] in join or string at morecurrent.pl line 69, line 11 (#1) Use of uninitialized value $switches[5] in join or string at morecurrent.pl line 69, line 11 (#1) Use of uninitialized value $switches[7] in join or string at morecurrent.pl line 69, line 11 (#1) Use of uninitialized value $switches[9] in join or string at morecurrent.pl line 69, line 11 (#1) Use of uninitialized value $switches[11] in join or string at morecurrent.pl line 69, line 11 (#1) Use of uninitialized value $switches[13] in join or string at morecurrent.pl line 69, line 11 (#1) Use of uninitialized value $switches[15] in join or string at morecurrent.pl line 69, line 11 (#1) Use of uninitialized value $switches[17] in join or string at morecurrent.pl line 69, line 11 (#1) A1 B1 B12 S S S S S S Use of uninitialized value $modelselect in string ne at morecurrent.pl line 19, line 11 (#1)