[102341] in RedHat Linux List
Re: What s wrong with this cgi script??
daemon@ATHENA.MIT.EDU (Thomas Ribbrock \(Design/DEG\))
Wed Dec 2 14:32:34 1998
Date: Wed, 2 Dec 1998 19:25:54 +0000
From: "Thomas Ribbrock \(Design/DEG\)" <argathin@iname.com>
To: redhat-list@redhat.com
Mail-Followup-To: redhat-list@redhat.com
In-Reply-To: <3.0.1.32.19981202142056.0068a094@pop.microtec.net>; from aromes@microtec.net on Wed, Dec 02, 1998 at 02:20:56PM -0800
Resent-From: redhat-list@redhat.com
Reply-To: redhat-list@redhat.com
aromes@microtec.net writes:
[Perl errors]
>
> #!/usr/bin/perl
> require "cgi.pl";
> &ReadParse;
> print STDOUT "Content-type: text/html\n\n";
> print STDOUT "<title>Mail form results</title>";
> print STDOUT "<h1>Mail form results</h1>;
^QUOTE!!
> open (MAIL, "|/usr/lib/sendmail $to") ||
> die "<p>Error: Couldn't execute sendmail.\n";
>
> print MAIL "To: $in{'to'}\n";
> print MAIL "From: $in{'from'}\n;
^QUOTE!!
> print MAIL "subject: $in{'subject'}\n\n";
> print MAIL "$in{'body'}\n";
> close MAIL;
>
> print STDOUT "<p>All right mailed the following to <tt>$to</tt>:\n";
> print STDOUT "<p><pre>";
> print STDOUT "To: $in{'to'}\n";
> print STDOUT "From: $in{'from'}\n";
> print STDOUT "subject: $in{'subject'}\n\n";
> print STDOUT "$in{'body'}\n";
> print STDOUT "</pre>";
Looks like you really need to watch those quotes...
I would highly recommend that you start using an editor like XEmacs or vim
for writing perl scripts. Their syntax highlighting features are extremely
helpful to avoid errors like these, as the colour of the rest of a line will
change if you miss a quote. Especially XEmacs is also helpful with
indentation, which can also indicate syntax problems at times (e.g. missing
";" at the end of a line).
HTH,
Thomas
--
"Look, Ma, no obsolete quotes and plain text only!"
Thomas Ribbrock | http://www.bigfoot.com/~kaytan | ICQ#: 15839919
"You have to live on the edge of reality - to make your dreams come true!"
--
PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
http://www.redhat.com http://archive.redhat.com
To unsubscribe: mail redhat-list-request@redhat.com with
"unsubscribe" as the Subject.