I would like some advise please, about warning errors that are being logged. The 'shebang' line and modules

#!/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


In reply to Action needed on warning errors ? by peterr

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.