On 15 Aug 2003 10:52:03 -0700, James <> wrote:
> Hi,
>
> I have the following:
>
> filename: Module1.pm
>
> package Module1;
>
> BEGIN {
> use Exporter();
> @ISA = qw(Exporter);
> @EXPORT = qw(&subroutine1);
> }
>
> sub subroutine1 {print "Hello!\n";}
> return 1;
> END { }
> ---------------------------------------------------
> Filename: Trial.cgi running in Tomcat 4.1.27
>
> #!c:\Perl\bin\perl.exe
>
> use CGI
> use Module1;
>
> subroutine1();
> .
> .
> .
> .
>
>
> When I run the script from my html page it asks for a file download. What am
> I doing wrong?
Besides forgetting to output a Content-type header followed by a blank
line (unless your server somehow guesses that), I suspect you are using
MSIE, which does not necessarily pay attention to MIME headers anyway.
So it guesses based on its own criteria, which might include filename
extension of the script. If that filename extension is associated with
Perl.exe, it considers that insecure and asks if you want to download or
execute it (not that you would have normally much luck executing CGI
output).
Note that MSIE considers "Content-type: text/plain" to be ambiguous (since
it often a default for unknown filetypes), and would go through its
guessing game for any text/plain content.
--
David Efflandt - All spam ignored
http://www.de-srv.com/
http://www.autox.chicago.il.us/ http://www.berniesfloral.net/
http://cgi-help.virtualave.net/ http://hammer.prohosting.com/~cgi-wiz/