[102329] in RedHat Linux List

home help back first fref pref prev next nref lref last post

What s wrong with this cgi script??

daemon@ATHENA.MIT.EDU (aromes@microtec.net)
Wed Dec 2 14:10:56 1998

From: aromes@microtec.net
Date: Wed, 02 Dec 1998 14:20:56 -0800
To: redhat-list@redhat.com
Cc: redhat-list-request@redhat.com, linux-admin@vger.rutgers.edu
Resent-From: redhat-list@redhat.com
Reply-To: redhat-list@redhat.com

Hello:
When I do "perl -c mailer.pl", my following script, I got errors:
Bare word found line 11, near "/usr/lib"(missing operator before lib?)
String found where operator expected at mailer.pl line 12, near "die"
(Might be a runnaway multi-line "" string starting on line 11(missing semi
colon on previous line??)
String found where operator expected at mailer.pl line 14, near "print MAIL""
(Might be a runnaway multi-line "" string starting on line 12)
missing semi colon on previous line??)
Bare word found line 14, near "print MAIL" TO"
(missing operator before lib?)


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

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;
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>";












































-- 
  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.


home help back first fref pref prev next nref lref last post