in reply to Configuration Problems

"Premature end of headers" (or something to that effect) is what the browser reports if upon attempting to invoke your script, something got printed before a proper CGI header was printed.

What got printed prior to the headers could be any of the following:

...and I'm probably missing a few possibilities.

You should check the following:

  1. Check the server's error log to see if it contains any hints. It probably will.
  2. Check the script's permissions and path, and the permissions and paths of any files the script needs to be able to access.
  3. Check that the script runs as expected from the command line. This will tell you if you have any compiletime or runtime errors, aside from errors that might only turn up when the script is run as 'nobody' (or whatever 'person' your webserver assumes). If the script uses CGI (as it probably should), running it from the commandline is easily done.
  4. Check to ensure that any use of relative paths is resolving to where you think it is.
  5. Make sure that if the script was carried from one operating system environment, to a different operating system, its line endings were converted. Common utilities for this are "dos2unix" and "unix2dos", or ASCII mode for your (hopefully) properly configured FTP client.
  6. Start debugging the script itself, following its logic to see if some sequence of events is causing it to print something else prior to the headers.

Ultimately your problem is probably a product of the CGI and Operating System environments, and probably not really a Perl-related issue.


Dave