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

[cobalt-users] Problem with CGI Script on a Qube 2



This is probably a pretty basic question but since I'm feeling like I'm in
idiot mode here goes:

I'm getting the following error message when trying to execute a CGI Perl
script:

"CGIWrap encountered an error while attempting to execute this script:

Error Message: No such file or directory
Error Number: 2
This message usually indicates there is a problem with the script itself.
The owner of the script needs to check the #! line for correctness."

Here is the script:

#!/usr/bin/perl

$tomail = "ssloan@xxxxxxxxxxxxx";
$location = "http://www.mincocorp.com/thanks.htm";;

read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
# Split the name-value pairs
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
 local($name, $value) = split(/=/, $pair);
 $value =~ tr/+/ /;
 $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
 # strip off any possible SSI comment tags.
 $value =~ s/<!--(.|\n)*-->//g;
 $in{$name} = $value;
 }

open (MAIL,"|/usr/sbin/sendmail -t -n -oi") ||
 die "there was a problem with the call to sendmail";

print MAIL "To: $tomail\n";
print MAIL "From: $in{'name'} <$in{'email'}>\n";
print MAIL "Reply-To: $in{'email'}\n";
print MAIL "Subject: $in{'subj'} (from Website)\n\n";

print MAIL $in{'body'};

close(MAIL);
print "Location: $location\n\n";


I'm calling the script from http://www.mincocorp.com/email.htm

I'd appreciate any help.

TIA

Stephen Sloan
MINCO Corporation
http://www.mincocorp.com
Comprehensive Real Estate Services