cancel
Showing results for 
Search instead for 
Did you mean: 

Help with perl

N/A

Help with perl

I am trying to run perl scripts on the ccgi server but every time I open the file in a webbrowser it shows me the code listing and not what the code should produce should it have been run.

#!/usr/bin/perl
print "Content_type: text/html\n\n";
while (($key, $val) = each %ENV){
print $key."=".$val."\n";
}

this should return all the environment variables and their values but when i look at the page I just get a copy of the code.

any help would be great.
3 REPLIES
N/A

Help with perl

Have you put it in the cgi-bin/ directory? That's the only place Perl will run.
N/A

perl problems

Yes have tried that and got a message saying the following

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, support@force9.net and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

this was generated accessing the following script inside the cgi-bin via a web browser i.e. http:\\ccgi.thomaswales.force9.co.uk\cgi-bin\test4.pl

this is the script

#!/usr/bin/perl

print "hello, world. \n";
N/A

Help with perl

It's Content-type not 'Content_type'. Try that and it should not show the code listing.