|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
I've just installed activeperl on IIS5 and everything runs smooth from the command line, however in the browser, i get;
CGI Error The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are: My test I can't find any reference to this prob in th docs. Thanks, db |
|
#2
|
|||
|
|||
|
It doesn't look like you included the headers that the app did return.
HTTP Headers are the parts of every web page transeferred that ask for/receive the correct page. In an HTTP request they indicate the name of the file that is wanted as well as any QUERY_STRING information. It also indicates the host name that should have the desired file. In the HTTP Response, the status line indicates the success or failure of the Request/Response, and the Content line indicates, you guessed it, the content of the page(eg., Content-Type: text/html ) This last line is a MUST in any CGI script using perl. You have to include at least the Content-Type header in the response. This, as far as I can see, is the source of many errors related to premature header endings. Solution. If you are using CGI.pm then you simply have to use the 'header' function with the content-type as its lone argument: Code:
#!/usr/bin/perl -wT $q = CGI->new(); print $q->header( "text/html" ); You have to print to make sure it goes to the 'output' file or requested page's source code. If, however you are not using CGI.pm(which you most definitely should be ), then you have use this:Code:
#!/usr/bin/perl -wT print <<EOF Content-type: text/html <HTML> <BODY> Your stuff here </BODY> </HTML> EOF This encloses you entire HTML code inside the 'EOF' delimiters for easier printing. Note that the first line is 'Content-type: text/html'. If this is not the first line, followed immediately by a blank line, you will get the header errors. For a quick tutorial in CGI & CGI.pm, click here. You might find it very helpful. Hope that helps.
__________________
- dsb - ![]() Perl Guy |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > HTTP headers |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|