How do I tell Perl to call the script <cwdmail.cgi> in <Debugger> mode> in the same fashion as if I just opened the Perl script in BBEdit and executed the menu command <Run in Debugger>?
Does it have to be done by altering the <post> line or is there a call inside the Script to invoke Debugging?
Neither. Some links:
<http://www.perl.org/CGI_MetaFAQ.html> <http://www.perl.com/doc/FAQs/cgi/perl-cgi-faq.html> (Especially Q4.19) <http://www.perl.org/troubleshooting_CGI.html>
The above covers the subject in depth. Here's some quickies:
Make certain you've asked Perl for all the diagnostic help it can give you, by including both 'use warnings;' and 'use strict;' in your script.
Use the CGI::Carp module with 'use CGI::Carp qw(fatalsToBrowser);' to get better error messages from your browser.
In general, it's simplest to take advantage of the CGI module's "offline" mode for serious debugging. (You could use the recently-announced Affrus debugger this way.)
Use the (oddly-named) 'splain' tool to get better 'splanations of terse error messages. Just run 'splain', and then paste in the text of the error message. Press ctrl-d when you're done. For example:
Sherm-Pendleys-Computer:~ sherm$ perl -e 'foo()'
Undefined subroutine &main::foo called at -e line 1.
Sherm-Pendleys-Computer:~ sherm$ splain
/usr/bin/splain: Reading from STDIN
Undefined subroutine &main::foo called at -e line 1.
Undefined subroutine &main::foo called at -e line 1 (#1)
(F) The subroutine indicated hasn't been defined, or if it was, it has
since been undefined.
(The above is actually a fairly poor example, as the "terse" message is already fairly clear, and the verbose version doesn't add all that much... most of the time, 'splain' is more useful than shown here.)
sherm--