0

when i ran a perl script on xampp i got this error

The server encountered an internal error and was unable to complete your request.

Error message:
Premature end of script headers: sai2.pl

If you think this is a server error, please contact the webmaster.

4
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by haonamdaica
0

with a CGI script it often means you tried to print something to the screen or perl tried to print something to the screen, like an error message, before the http header was printed.

See your other thread, that is probably where the error is occuring. You had the shebang line messed up. When the shebang line is bad perl and the http server can't do anything except return the error message you see.

Its always good to add this line to perl based CGI scripts:

use CGI::Carp qw/fatalsToBrowser/;

although in the case of a bad shebang line it doesn't help since perl can't even be started.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.