I'm sure someone could answer this very quickly, but I'm just new to perl...
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.
Have I missed any permissions or is there some other way of making this work? Any advise would be appreciated.
sub generate_ticket {
my @args = ("$base_path/test.pl");
exec(@args);
}
This is called somewhere in file like this:
} elsif ($FORM{'delete_type'}=~/generate/) {
my $message = &generate_ticket($delete_array_ref);
#&ack_events($delete_array_ref);
$events_deleted = (@$delete_array_ref);
&push_message("<FONT COLOR=red><B>Result: $message.</B></FONT>");
}
test.pl:
#!/usr/bin/perl
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%5Fevents&limit=60&sid=35