One thing that shows up again and again are blocks of print statements like this; and of course Perl has an easier way for you to do it. For instance, you can chain print statements together with commas:print "Welcome $username\n\n"; print "Please chose from the following options:\n"; print "1) Establish PPP Session\n"; print "2) Logoff\n"; print "------------------------\n"; print "Choice: ";
And of course Perl will allow you to get rid of all those extra quotes and commas:print "Welcome $username\n\n", "Please chose from the following options:\n", "1) Establish PPP Session\n", "2) Logoff\n", "------------------------\n", "Choice: ";
Or probably even better, use a HERE docprint "Welcome $username Please chose from the following options: 1) Establish PPP Session 2) Logoff ------------------------ Choice: ";
print <<EOP; Welcome $username Please chose from the following options: 1) Establish PPP Session 2) Logoff ------------------------ Choice: EOP
In reply to Re: Shell Menu Code Review
by Sifmole
in thread Shell Menu Code Review
by PrimeLord
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |