in reply to Problems with scripts
You might want to rewrite this section of code so that it is a little clearer:
if ($location eq ""){ &main }elsif ($location eq lc("misc")){ &misc }elsif ($location eq lc("links")){ &links }else{ default('Where are you trying to go?'); }
by using a switch construct (which is really an abuse of a looping construct):
SWITCH: for ($location) { /^$/ && do {&main() ;last SWITCH}; /^misc$/i && do {&misc() ;last SWITCH}; /^links$/i && do {&links() ;last SWITCH}; default('Where are you trying to go'); # catch anything else }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Problems with scripts
by arturo (Vicar) on Nov 27, 2000 at 03:21 UTC |
In Section
Seekers of Perl Wisdom