in reply to Re^3: a classic : 'Premature end of script headers' problem
in thread a classic : 'Premature end of script headers' problem

The error log for my server just gives
[Wed Sep 19 13:42:19 2007] [error] [client xxx.xxx.122.100] Premature end of script headers: consent.cgi, referer: http://mysite.com/ase-workkeys/employerconsent.html
over and over again.

As for the subroutine calling, I used to call them with the () and no &, but someone told me that was unnecessary if the subroutine did not return any values. What is the danger? I am asking seriously. Thanks.


I learn more and more about less and less until eventually I know everything about nothing.

Replies are listed 'Best First'.
Re^5: a classic : 'Premature end of script headers' problem
by Joost (Canon) on Sep 19, 2007 at 18:53 UTC
    The danger is that calling a sub as &subname; (with an ampersand, without parentheses) will pass on the current subroutine's @_ argument array. Which is almost never what you want to do.

    Using both parentheses and & sign is the same as just parentheses, and you can usually get away without parentheses too, provided the subroutine is defined before the call.

Re^5: a classic : 'Premature end of script headers' problem
by leocharre (Priest) on Sep 19, 2007 at 18:50 UTC
    did you mistakingly change ownership to root? for example, deleted and recreated consent.cgi? Also, is consent.cgi chmod 0755 ? do ls -lha /your/path/to/consent.cgi
      No, ownership is still to the correct account, not root.
      It is properly chmod'ed. That part I do understand.

      I learn more and more about less and less until eventually I know everything about nothing.