peterr has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -wT use CGI qw/:standard/; use DBI; use Net::SMTP; use CGI::Carp qw(fatalsToBrowser); BEGIN { use CGI::Carp qw(carpout); open(LOG, ">>/home/username/cgi-bin/mycgi-log") or die("Unable to open mycgi-log: $!\n"); carpout(LOG); } # resource limits $CGI::DISABLE_UPLOADS = 1; $CGI::POST_MAX = 1024;
The first line in the log file
Unquoted string "footer" may clash with future reserved word at line 714.
print footer;
So, I will call it "page_footer" or something I guess.
The next line in the log file
Unquoted string "break" may clash with future reserved word at line 716.
sub check_value_combinations { diehtml($comb_error) if defined $comb_error; print footer; break; }
Is this one caused by the footer problem, or , if not, what else do I put in place of the 'break' ?
Name "main::LOG" used only once: possible typo at line 10.
BEGIN { use CGI::Carp qw(carpout); open(LOG, ">>/home/username/cgi-bin/mycgi-log") or die("Unable to open mycgi-log: $!\n"); carpout(LOG); }
Line 10 , is the "open(LOG, .." code
Use of uninitialized value in concatenation (.) or string at line 256.
print "<form><input type=\"hidden\" name=\"confirmed\" value=\"yes\">" +; print "<input type=\"hidden\" name=\"name\" value=\"$name\"> <input type=\"hidden\" name=\"surname\" value=\"$company\">
Line 256 is the second PRINT command, and there are many input lines, the last is finished with a \n"; . The var $name is defined early in the form
$name = cgi_get('name') and $name =~ s/'`-\w\s//go; # filter name
The only other question I had concerning the script is, just after the 'shebang' line, there is the use of modules Net::SMTP and CGI::Carp , which of course are needed, but what are the other modules used for, and the 'resource limits' code
use CGI qw/:standard/; use DBI; # resource limits $CGI::DISABLE_UPLOADS = 1; $CGI::POST_MAX = 1024;
Should anything be changed in the above code, or additional lines needed ?
Thanks, :)
Peter
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Action needed on warning errors ?
by Roger (Parson) on Oct 07, 2003 at 04:34 UTC | |
by BUU (Prior) on Oct 07, 2003 at 05:16 UTC | |
by peterr (Scribe) on Oct 07, 2003 at 05:16 UTC | |
by BUU (Prior) on Oct 07, 2003 at 17:25 UTC | |
by peterr (Scribe) on Oct 08, 2003 at 02:03 UTC |