joshua has asked for the wisdom of the Perl Monks concerning the following question:
I'm starting a project that will probably take me the whole summer to complete.
Anyway, I'm starting by making the administration part of the site. I need it to do different tasks like change password, add new users, delete users, etc. Would it be better to have these tasks incorporated in the same script or to have them run with multiple scripts?
If I use the same script, should I seperate these tasks into subs? Or, should I use ifs and elsifs to tell the script what to do? E.g. ...
my $action = param('action'); if ($action eq 'foo') { # Do stuff } elsif ($action eq 'bar') { # Do stuff }
Or...
Thanks for any input.if ($action eq 'foo') { foo(); } elsif ($action eq 'bar') { bar(); } sub foo { # Do stuff } sub bar { # Do stuff }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(crazyinsomniac) Re: Multiple tasks in same_script, or multiple_scripts?
by crazyinsomniac (Prior) on Jun 02, 2002 at 03:11 UTC | |
|
Re: Multiple tasks in same_script, or multiple_scripts?
by mfriedman (Monk) on Jun 02, 2002 at 03:54 UTC | |
|
Re: Multiple tasks in same_script, or multiple_scripts?
by rbc (Curate) on Jun 02, 2002 at 05:20 UTC | |
|
Re: Multiple tasks in same_script, or multiple_scripts?
by r0b (Pilgrim) on Jun 02, 2002 at 08:54 UTC | |
|
Re: Multiple tasks in same_script, or multiple_scripts?
by 5-7-5 (Initiate) on Jun 02, 2002 at 04:46 UTC | |
|
Re: Multiple tasks in same_script, or multiple_scripts?
by Aristotle (Chancellor) on Jun 02, 2002 at 14:39 UTC | |
|
Re: Multiple tasks in same_script, or multiple_scripts?
by joshua (Pilgrim) on Jun 03, 2002 at 16:24 UTC |