[Xitami] Off Topic Perl Programmer
Paul Reid
xitami@lists.xitami.org
Fri, 13 Jul 2001 17:22:34 -0400
> <Input type="Text" name="Name" value="David">
> print "$ENV{FORM_name}\n"
Perl variable names are case sensitive. name is not the same as Name.
> it doesn't show me anything on the page.
Always have some simple literal text that "must" display, without any
tricky variables or calculations:
print "Hello there! You typed: \n";
Then you know if the script is sick, or you just printed an invalid
variable.
> The script doesn't return any errors....
The script you cited will never barf-back errors (they may go out into a
log file, but in this case probably not).
Start all your CGI Perl scripts with this:
use strict;
use CGI qw(:standard);
use CGI::Carp qw(fatalsToBrowser);
"strict" will catch many "easy" errors.
The "fatalsToBrowser" option of CGI Carp will send error messages to you
(in the browser) rather than in some obscure log file. You "may" want to
disable this when your script runs perfectly; but in debugging it is a
real time saver.
There is an even better version of this error catching code but I don't
have it handy. It catches compile-time errors and lets you set a custom
message.
-PRR