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: ";
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",
"Please chose from the following options:\n",
"1) Establish PPP Session\n",
"2) Logoff\n",
"------------------------\n",
"Choice: ";
And of course Perl will allow you to get rid of all those extra quotes and commas:
print "Welcome $username
Please chose from the following options:
1) Establish PPP Session
2) Logoff
------------------------
Choice: ";
Or probably even better, use a HERE doc
print <<EOP;
Welcome $username
Please chose from the following options:
1) Establish PPP Session
2) Logoff
------------------------
Choice:
EOP
|