Tanalis has asked for the wisdom of the Perl Monks concerning the following question:
I'm responsible for a small community website, being in the middle of a redesign to allow us to provide some member-specific content, and moving from an SHTML/PHP-based solution to a Perl/CGI one.
I've implemented a fairly simple application to handle the majority of user requests and information processing. My main niggle with this at the minute (and the point of this post) is the script's event handling (requests for pages, user login/logouts, this sort of thing). This currently takes the form of a set of if ... then ... else statements, but seems to run quite slowly when there's load on the site, and I'm generally not happy with it - the code is ugly, and already a nightmare to make changes to.
I'm considering implementing a system whereby CGI parameters directly map to subs, probably through a hash (as eval &$c->param is obviously insecure), but I'm not 100% convinced that this is the most sensible way to go.
I've also looked at the CGI::Application module, but I can't help but think that this would be overkill for what I'd be doing with it.
I'd be interested to know what suggestions people have for event handling with CGI, and opinions of the "best" way to go with this.
Thanks in advance,
-- Foxcub
A friend is someone who can see straight through you, yet still enjoy the view. (Anon)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Event Handling in CGI
by Coruscate (Sexton) on Mar 18, 2003 at 09:00 UTC | |
|
•Re: Event Handling in CGI
by merlyn (Sage) on Mar 18, 2003 at 12:56 UTC | |
by dash2 (Hermit) on Mar 18, 2003 at 15:25 UTC | |
|
(jeffa) Re: Event Handling in CGI
by jeffa (Bishop) on Mar 18, 2003 at 15:34 UTC | |
|
Re: Event Handling in CGI
by benn (Vicar) on Mar 18, 2003 at 11:26 UTC | |
|
Re: Event Handling in CGI
by robartes (Priest) on Mar 18, 2003 at 10:02 UTC |