Debugging a CGI Script
Victor Odhner
plug-discuss@lists.plug.phoenix.az.us
Fri, 10 May 2002 08:29:54 -0700
I had writtten this:
> Debugging at the command line allows you to use
> the -w option (which you should NOT use in a
> production CGI), ...
Tony Wasson wrote:
> I always thought you *test* with -w and get everything
> coded right and then run without it.
You're right, Tony, I think we're saying the same thing.
Basically most of what -w will do for you is going to
happen any time you activate the script, and it will
spew messages for bad syntax or bad practice which
you should eliminate.
But there seem to be some cases where -w will give you
a message based on the program's execution flow -- for
example maybe if you should referenced an undefined
variable in an evaluated statement?
That's why, when you install a CGI for production,
you don't want -w in its #! line, because it might
pop up with some new warning message that will cause
the resulting page to have bad syntax, so all the
user sees is a server error message. And of course
these may be hard to diagnose, depending on how
much gets into the server's error log.
Vic
http://members.cox.net/vodhner/
Helping Grow the Techoasis - http://www.techoasis.org