#!/usr/bin/perl use warnings; print "********************************************\n"; print "* test app\n"; print "* Version 0.2 - \"The mule\"\n"; print "********************************************\n"; print "\n"; #Define global args my @menu_list = ( "&default", "&get_ifc_name({'ifc_default' => 'test.ifc0'})", "&get_ip_address({'ipaddr_default' => '10.20.1.1'})", "&headr_section", ); &menu_system; sub menu_system(){ #Define our menu system here with the appropriate subs and thier arguments $bs_index = shift; #first run check to setup the first menu if(!$bs_index){ #start things off at the first menu $bs_index = "1"; } print "\n*** DBG MENU SYSTEM: Index from args: $bs_index ***"; #check to see if the menu index is defined, otherwise display an error. if (defined $menu_list[$bs_index]){ #menu is valid, run the sub print "\n*** DBG MENU SYSTEM: running ID: $bs_index ***\n\n"; eval($menu_list[$bs_index]); } else { print "*** Unknown Menu Called***\n"; } } sub get_ip_address() { my($arg) = shift; print "IP for the Interface [ \"$arg->{'ipaddr_default'}\" ]\n"; $ip_addr = ; chomp($ip_addr); &menu_system("3"); } sub get_ifc_name() { my($arg) = shift; print "Enter an Interface Name [ \"$arg->{'ifc_default'}\" ]\n"; $device_name = ; chomp($device_name); &menu_system("2"); } sub headr_section{ print "*******************************************\n"; print "* Section 2 Header\n"; print "* To skip a step, type \"skip\"\n"; print "* To go back a step, type \"back\"\n"; print "* To restart this step, type \"restart\"\n"; print "********************************************\n\n"; }