itsmcfly32@ma.rr.com has asked for the wisdom of the Perl Monks concerning the following question:

Running a .pl file in Windows opens a "File Download" window
how can i stop this asking me to open this file i need it to just open and run it

<?php mail("myemailaddress@ishere", "Checked In ", "stoped by your sit +e") ; ?>

i have that all working but like i said when i go to my site at Http://something.com/my.pl it pops up that File Download window
I am running Windows 98 and my web server is called savant 3.1

Edit, BazB: reformatted, added code tags around the PHP (!), shortened title (was: 'need help Running a .pl file in Windows opens a "File Download" window how can i stop this from poping up')

Replies are listed 'Best First'.
Re: Problems running code with .pl extension
by Corion (Patriarch) on Nov 01, 2003 at 18:41 UTC

    My guess is that your webserver is sending no MIME type or that your script is not outputting the correct headers.

    Another thing could be that your Perl script is not seen as executable by your webserver, either because your webserver does not allow scripts to be executed, or because your script does not reside in the cgi-bin directory or because your script is not set executable.

    Make sure that your script is executable, that it is in a place where other scripts are already working.

    Then, make sure your script outputs Content-Type: text/html as its first header line, possibly by running it locally from the command line and looking at the output.

    I'm confused what you mean by the line:

    <?php mail("myemailaddress@ishere", "Checked In ", "stoped by your sit +e") ; ?>

    This site is mostly about Perl, and you won't find that much PHP help here.

    perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The $d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider ($c = $d->accept())->get_request(); $c->send_response( new #in the HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web
Re: Problems running code with .pl extension
by eoin (Monk) on Nov 01, 2003 at 22:09 UTC
    I also had a problem like this at one stage. You'll find it here.
    This is most probably a MIME error. Are you using CGI.pm to send create the HTML or are you just printing out your own. Sometomes servers can be fussy and don't accept your own. And it is also very easy to include the Content-Type: text/htmlline.
    Make sure that your script is in the cgi-bin folder of your server and that it has been set as and executable chmod 755
    Also if in future you could supply us with a sample of the problem scripts we could help alot more.
    Hope this helps

    All the Best, Eoin...

    If everything seems to be going well, you obviously don't know what the hell is going on.

Re: Problems running code with .pl extension
by castaway (Parson) on Nov 02, 2003 at 14:11 UTC
    Taking a wild guess from your example 'code', I'd say you're trying to run PHP code in a '.pl' file, the httpd server probably doesnt recognise that as a .pl file (no mod_perl etc installed?), and just thinks you want to download it, since it cant show it any other way..

    Try saving the file as a .php file instead?

    C.