I'm sure someone can answer this very quickly, but I'm just not familiar with perl ...
I am trying to modify demarc (a simple network monitoring tool) to make 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. The permissions for the script are set to 777. When I comment on the system () call, everything is fine. Therefore, I suspect this is a system () call where an error occurs. I also tried exec (), but that didn't work either. The error cannot be in the script itself, since it has only an "echo test".
Am I missing any permissions or is there another way to make this work? Any recommendations would be appreciated.
sub generate_ticket {
my @args = ("$base_path/test.pl");
exec(@args);
}
This is called somewhere in the file as follows:
} elsif ($FORM{'delete_type'}=~/generate/) {
my $message = &generate_ticket($delete_array_ref);
$events_deleted = (@$delete_array_ref);
&push_message("<FONT COLOR=red><B>Result: $message.</B></FONT>");
}
test.pl:
print "Test";
Error log: [Mon Nov 30 14:58:22 2009] [error] [client 127.0.0.1] Premature end of script headers: demarc, referer: http: // localhost / dm / demarc? Td = show_events & limit = 60 & sid = 35
source
share