|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
|
Re: Reading group for PATH (fwd)
|
> >>>>> "SH" == Simply Hao <hao@netaxs.com> writes:
> >> And heck, some of it (chapter two especially) is quite applicable
> >> to CGI stuff.
> SH> You mean using dispatch tables for handling state in CGI?
>
> I was thinking more of for doing different things to input data based
> on a parameter from a select box, or even something hidden. One cgi,
> multiple possibilities. Or even for processing each value.
That sounds quite reasonable. It's much more important to program
defensively when doing CGI programming; using dispatch tables makes error
handling a breeze:
if ($dispatch{$cgi_param}) {
## do something
} else {
## standard error handling
}
or even
throw_error_and_quit() unless $dispatch{$cgi_param};
## no worries here
And, of course, maintenance becomes *much* easier.
Sorry if this was an obvious insight or otherwise mentioned. I haven't
read the drafts yet.
Z.
**Majordomo list services provided by PANIX <URL:http://www.panix.com>**
**To Unsubscribe, send "unsubscribe phl" to majordomo@lists.pm.org**
|
|