Here is what happens when your run a CGI script:
- The web server sets up a "CGI environment" and then executes the script.
- The "perl" program runs your script
- The web server expects the script output to start with headers followed by a blank line followed by the content to pass along to the web browser.
From the error message you can tell that the failure is with step #2 or step #3. From your code, it is apparent that it is at least step #3 - you did not output a set of headers.
At the minimum you need a Content-Type header. Observe.
$mime_type = 'text/html';
$header_content_type = "Content-Type: $mime_type\n";
@headers = ($header_content_type);
$blank_line = "\n";
$content = "
The reason you get "premature end of headers" messages is because the output the web server sees is not a set of headers. Other than skipping the headers like your script does, you can also get this message if the perl program has a problem interpreting your code (syntax errors, etc) or crashing.
openvein.org -//- One-time [color=#6600CC]$50.00 discount[/color] on [color=#0000CC]DreamHost[/color] plans: Use ATROPOS7