One of my Perl CGI scripts works fine if I reference it with an absolute URL (“http://my.domain.com/cgi-bin/cgi_script.cgi”).
However, it will not work if I reference it via a relative URL ("…/cgi-bin/cgi_script.cgi"), producing the infamous “premature end of script header” error.
The relative URL seems to be valid; if I place an HTML doc in the cgi-bin directory, I can reference it with the same relative URL without any problem.
Any ideas? I would really like to use relative URLs wherever possible.