Web Hosting Talk







View Full Version : Perl on Winnt Problem


mpkapadia
06-14-2001, 10:54 AM
I have installed activeperl on my winnt server,
Perlscript through Asp works but when i run .pl files it gives errors

This is a sample .pl file

print "Test Sample";



It gives following error

CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:


Test Sample


Why is this happening ?

Regards
Manish Kapadia

Chas
06-14-2001, 11:07 AM
Did you print a header somewhere? Your script should look something like this:


#!/usr/bin/perl

#This might give you a better error description
use CGI::Carp qw/fatalsToBrowser/;
use strict;

print "Content-type: text/html\n\n";
print "Test Sample";



Do you get any error messages when you run the script from a command prompt?

Regards,
Charlie

MattF
06-14-2001, 11:12 AM
Essentially your missing:
print "Content-type: text/html\n\n";


#!/usr/bin/perl - Not Necessary on NT platform (might cause error)

use CGI::Carp qw/fatalsToBrowser/;
use strict;

-Optional. Not necessary, try without it until you get going.

mpkapadia
06-14-2001, 12:27 PM
Thanks a million all of you,

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

was missing

I actually wanted to test if perl was working fine on the server, so i just picked up the sample perl file to check the same


Thanks a lot once again, This is such a nice place to be

Regards
Manish Kapadia