Re: CGI displays contents of script



jackson_samson@xxxxxxxxxxx wrote:
On Jul 31, 2:43 pm, Paul Lalli <mri...@xxxxxxxxx> wrote:
On Jul 31, 2:38 pm, jackson_sam...@xxxxxxxxxxx wrote:

I have installed perl 5.8.8 which already has the CGI included in it.
I created a small test script that uses the CGI.pm. When I run the
following in my browser, it shows me the entire script and does not
execute the script. Does anyone know why this happens?
Here is my output from the web browser:
#!/usr/bin/perl use CGI; print "Content-type: text/plain\n\n"; print
"TEST";
Because your web server is configured to display .cgi scripts rather
than execute them. This has nothing to do with Perl and everything to
do with web server configuration. You will get better assistance from
a group that talks about web server configurations.

Paul Lalli

That makes sense. Thanks for your answer.


Also, once you modify your Web server, the shebang line should be on a line by itself.

#!/usr/bin/perl
use CGI; print "Content-type: text/plain\n\n"; print "TEST";

or.. actually using the CGI module...

#!/usr/bin/perl
use CGI qw( :standard );

print header( 'text/plain' ), 'TEST';
.



Relevant Pages

  • Re: system call
    ... I am using a cgi to call a pl script and then pass xml back to ... the web browser. ... as $pid will contain only decimal digits. ...
    (comp.lang.perl.misc)
  • CGI and Methods??
    ... I'm trying my hand at scripting cgi in ruby. ... looking at Rails. ... Below is a script I'm working on to provide a web interface to our ... This way we don't cause the browser to time ...
    (comp.lang.ruby)
  • CGI and Methods??
    ... I'm trying my hand at scripting cgi in ruby. ... looking at Rails. ... Below is a script I'm working on to provide a web interface to our ... This way we don't cause the browser to time ...
    (comp.lang.ruby)
  • Re: Trying to read xml output from Acrobat form
    ... > I've made a little form in Acrobat 7.0 Professional with a submit ... Check to make sure the complete URL of your script is in the submit action. ... I'd suggest you set up Firefox as your browser, ... > I have a little cgi set up on my personal server: ...
    (comp.lang.perl.misc)
  • Re: cannot open and write file
    ... your script does not seem to be a CGI script. ... To see if you have set up your web server correctly. ... whole wide world write access to root's home directory. ...
    (comp.lang.perl.misc)