I have a perl process running. When it starts up it writes it's PID into a file. It also has a signal trap.
When I run a file (kill.pl) with this code in it from the command line, it traps the signal:
#!/usr/bin/perl -w
# attempt to kill a pid
use strict;
my $pid;
open (PID, "<signwriter.pid");
while(<PID>){
$pid = $_;
}
kill 'ALRM', $pid;
However, if I run the same code as part of a CGI process (called from a web-form), or if I try and run
kill.pl from
system "perl ./kill.pl";
nothing seems to happen.
I don't understand :(