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)
In reply to Event Handling in CGI by Tanalis
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |