0

I am trying to run this script

mail.pl

#!/usr/bin/perl

print "Content-type: text/html \n\n"; #HTTP HEADER

#CREATE
$email = "pt-desu\@*****-****.com";

#PRINT
print "$email<br />";

The file could be accessed via http://mysite.com/p/cgi-bin/mail.pl but when you go there the browser proms to download the file and does not display anything

PT Desu
  • 693
  • 4
  • 13
  • 26
  • 1
    I see a server error - page not found. That's more of an server (Apache??) setup problem if it's not executing dirt-simple Perl. – Axeman Apr 08 '11 at 16:31
  • From the [SO Perl FAQ](http://stackoverflow.com/questions/tagged/perl?sort=faq): [How can I troubleshoot my Perl CGI script?](http://stackoverflow.com/questions/2165022/how-can-i-troubleshoot-my-perl-cgi-script) – daxim Apr 08 '11 at 17:57

1 Answers1

2

Your webserver isn't set up to process *.pl files as Perl; it's instead just serving them up as plain-text. Consult your webserver's documentation for setting this up.

For Apache, try consulting this tutorial. The key bits are:

AddHandler cgi-script .cgi .pl

and

<Directory />
  Options FollowSymLinks
  AllowOverride None
</Directory>

and

Options FollowSymLinks +ExecCGI

...in your httpd.conf file.

CanSpice
  • 34,814
  • 10
  • 72
  • 86