[102340] in RedHat Linux List

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

Re: What s wrong with this cgi script??

daemon@ATHENA.MIT.EDU (Steve Borho)
Wed Dec 2 14:29:06 1998

Date: Wed, 2 Dec 1998 13:17:10 -0600
From: Steve Borho <sborho@ststech.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

On Wed, Dec 02, 1998 at 02:20:56PM -0800, aromes@microtec.net wrote:
> 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 "<html> <head>";

> print STDOUT "<title>Mail form results</title>";

print "</head> <body>";

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

print "</body> </html>";

-- 
Steve Borho


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