I don't like use strict at all...
I just tested it on a script I am writing, and it gives me error messages for my Parse Form Sub-Routine...
Code:
sub Parse_Form {
if ($ENV{'REQUEST_METHOD'} eq 'GET') {
@pairs = split(/&/, $ENV{'QUERY_STRING'});
} elsif ($ENV{'REQUEST_METHOD'} eq 'POST') {
read (STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
if ($ENV{'QUERY_STRING'}) {
@getpairs =split(/&/, $ENV{'QUERY_STRING'});
push(@pairs,@getpairs);
}
} else {
print "Content-type: text/html\n\n";
print "<P>Use Post or Get";
}
foreach $pair (@pairs) {
($key, $value) = split (/=/, $pair);
$key =~ tr/+/ /;
$key =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~s/<!--(.|\n)*-->//g;
if ($formdata{$key}) {
$formdata{$key} .= ", $value";
} else {
$formdata{$key} = $value;
}
}
}
And the error messages...
Code:
[Fri Nov 26 19:38:46 1999] admin.cgi: Global symbol "buffer" requires explicit p
ackage name at /www/webhostarea/cgi-bin/mailing_list/admin/admin.cgi line 71.
[Fri Nov 26 19:38:46 1999] admin.cgi: Global symbol "getpairs" requires explicit
package name at /www/webhostarea/cgi-bin/mailing_list/admin/admin.cgi line 75.
[Fri Nov 26 19:38:46 1999] admin.cgi: Global symbol "pair" requires explicit pac
kage name at /www/webhostarea/cgi-bin/mailing_list/admin/admin.cgi line 83.
[Fri Nov 26 19:38:46 1999] admin.cgi: Global symbol "key" requires explicit pack
age name at /www/webhostarea/cgi-bin/mailing_list/admin/admin.cgi line 84.
[Fri Nov 26 19:38:46 1999] admin.cgi: Global symbol "value" requires explicit pa
ckage name at /www/webhostarea/cgi-bin/mailing_list/admin/admin.cgi line 84.
[Fri Nov 26 19:38:46 1999] admin.cgi: Global symbol "formdata" requires explicit
package name at /www/webhostarea/cgi-bin/mailing_list/admin/admin.cgi line 92.
If I used that code in Links SQL, how would I fix it?