Phillip Bruce wrote:
Wiggins d'Anconia wrote:

<snip>




Thanks for the suggestions. Now I get totally different error. I ran
this on the command line and get following:

% ./survey.cgi
Content-type: text/html

Substitution replacement not terminated at ./survey.cgi line 37.

Here is my code changes I've made:

#!/usr/local/bin/perl
use strict;
user warnings;

In the above line you have 'user' instead of 'use'....


use CGI;
use Mail::Internet;

BEGIN {
  print "Content-type: text/html\n\n";
}  # So we can debug using the web

# Collect parameters using CGI
my $customer = param("Customer");
my $learn = param("Learn");
my $opinion = param("Site Opinion");
my $improvements = param("Site Iimprovement");
my $comments = param("comments");

my $head = Mail::Header->new;
# add an error handler here for the above

$head->add(From => 'Webmaster <[EMAIL PROTECTED]>');
$head->add(To   => '[EMAIL PROTECTED]');
$head->add(Subject => 'Peggy's Health Center Survey Response');


In the above literal you have an embedded single quote which must be escaped or you need to change the quoting method. To escape a single quote in a single quoted literal throw a backslash before it...


'Peggy\'s Health Center Survey Response', that *should* be the reason it is failing....

# Build the body of your message
my $body = <<END;
The following information has been sent via form:

Customer Type: $customer
Where They Found US: $learn
Site Opinion: $opinion
Site Improvements: $improvements
Comments: $comments
END

#Send the message
$mail = Mail::Internet->new(Header  => $head,
                            Body    => [$body],
                            Modify => 1);

print $mail->end('sendmail');


=== End of Code ===


Any ideas why I'm getting that error:
I'm using 5.8 version of perl and
have an older version 5.005_03
that does the same thing.


Stick with 5.8 unless you need the older version for some reason...


http://danconia.org


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to