[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Script errors



Your name, E-Mail address,
information on the product, price, and time for the add to run must
be entered before the system can accept your request.
The number of weeks to run must be between 1 and 8.
Please check these and try again.

Back

Diagnostic Output

Out of memory!

is outputted when I use this script:

#!perl

$| = 1;
if ($ENV{'REQUEST_METHOD'} eq 'POST')
{
				read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
				@pairs = split(/&/, $buffer);
				foreach $pair (@pairs)
				{
					($name, $value) = split(/=/, $pair);
					$value =~ tr/+/ /;
					$value =~
s/%([a-fA-f0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
					$contents{$name} = $value;
					}
}

$name = $contents['name'];
$addy1 = $contents['addy1'];
$addy2 = $contents['addy2'];
$city = $contents['City'];
$state = $contents['State'];
$zip = $contents['Zip'];
$zip2 = $contents['Zip2'];
$phone = $contents['Phone'];
$email = $contents['E-mail'];
$category = $contents['category'];
$subject = $contents['Subject'];
$info = $contents['info'];
$price = $contents['price'];
$time = $contents['time'];

if (($name eq "") || ($email eq "") || ($info eq "") || ($price eq "") ||
($time eq "") || ($time > 8) || ($time < 1)) {
print <<END;
Your name, E-Mail address,<br>
information on the product, price, and time for the add to run must<br>
be entered before the system can accept your request.<br>
The number of weeks to run must be between 1 and 8.<br>
Please check these and try again.<br><br>
<a href = "submit.html">Back</a>
END


}

#”checks for empty 'required' fields

$perinfo = "$name\n$addy1\n$addy2\n$city $state $zip $zip2\n$phone\n$email";
#”puts personal info, formatted, into one variable.

$prodinfo = "$category\n$subject\n$info\n\n$price\n$time";
#”puts product info, formatted, into one variable.

print "$prodinfo\n\n$perinfo";
print "\n";

open(FILE, "<classifieds.data");
read(FILE, $data, 20000000);
close FILE;

$data .= "$prodinfo\n\n$perinfo\t";

open( OUT , ">classifieds.data");
print( OUT "$data");

but I have the CGI's memory set to 512k, and macperl has 5 megs. The finder
says it's only using 1/10 of that. Why am I getting this error? I don't
think anything's recursive. Worse still, if I put an exit in the first 'if'
statement, so that it won't do the rest of the script, it quits perl, (not
what it's SUPPOSED to do, as far as I know, but maybe cgi glue makes it
different) but NOT the cgi, which then won't quit at all.

-Seraph



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch