Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy does my Perl CGI complain about "Premature end of script headers"?
    text
    copied!<p>I'm sure someone could answer this very quickly, but I'm just new to perl...</p> <p>I'm trying to modify demarc (a simple network monitoring tool) to do a system call to a simple script. The script itself does nothing, I'm just trying to do a 'proof-of-concept' because I keep getting an internal server error. Permissions to the script have been set to 777. When I comment the system() call, everything's fine. So that makes me suspect that it's the system() call where the error's happening. I've also tried exec(), but that didn't work also. The error could not be in the script itself since there's only an echo "test" in it.</p> <p>Have I missed any permissions or is there some other way of making this work? Any advise would be appreciated.</p> <pre><code>sub generate_ticket { my @args = ("$base_path/test.pl"); exec(@args); } </code></pre> <p>This is called somewhere in file like this:</p> <pre><code>} elsif ($FORM{'delete_type'}=~/generate/) { my $message = &amp;generate_ticket($delete_array_ref); #&amp;ack_events($delete_array_ref); $events_deleted = (@$delete_array_ref); &amp;push_message("&lt;FONT COLOR=red&gt;&lt;B&gt;Result: $message.&lt;/B&gt;&lt;/FONT&gt;"); } </code></pre> <p>test.pl:</p> <pre><code>#!/usr/bin/perl print "Test"; </code></pre> <p>Error log: [Mon Nov 30 14:58:22 2009] [error] [client 127.0.0.1] Premature end of script headers: demarc, referer: <a href="http://localhost/dm/demarc?td=show_events&amp;limit=60&amp;sid=35" rel="noreferrer">http://localhost/dm/demarc?td=show_events&amp;limit=60&amp;sid=35</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload