in reply to Calling Perl from HTML

It should look like this (incl some unrelated improvements) - note the lack of ^M:
#!/usr/bin/perl -w use strict; my $sendmail = "/usr/sbin/sendmail -t"; my $recipient = "schafferm\@ameritech.net"; open(SENDMAIL, "|$sendmail $recipient") or die "Cannot pipe to $sendma +il: $!"; print SENDMAIL <<"END_MAIL"; From: Foo\@Bar.com Subject: Request to share information To: user\@ameritech.net Hello... END_MAIL close(SENDMAIL); print "Content-type: text/plain\n\nMail sent.";

Don't forget something like the last line. The webserver expects the script to produce a valid HTTP reply.

In reply to grag: no, just didn't think of it :-)

Makeshifts last the longest.

Replies are listed 'Best First'.
Re: Re: Calling Perl from HTML
by graq (Curate) on Jul 17, 2002 at 13:14 UTC
      Nope - you are correct - probably s/b w/ ' instead of " - eventually I will be passing a $scalar.