You probably want to die here, otherwise both processes (open here does an implicit fork) would continue to run in the event your exec fails.
Instead of exiting, consider die (or croak with the Carp module, if appropriate), which would give you the opportunity to describe the reason you're aborting the script:
You can set $! if you need control over the exit value beforehand.die "File is empty" if eof FROMKID;
Your code will be a bit more readable if you were to use, say, 'TERM' instead of 15.
While I don't see any immediate problem, since $! probably won't be touched by the user, you don't generally want to call syslog with only a single (well, this second) argument, because it leaves you open to format-based attacks. If you only have a single message that might contain user-supplied data (or anything, even incidental, that could have something that looks like a sprintf-style format), you want to call syslog like this:
Which means you'd modify your call to system_log thus: system_log('%s', "Couldn't exec ps: $!"). Again, this doesn't look like a problem here, but you should get into the habit so you don't accidentally leave yourself open in the event your code is vulnerable. Taint-checking under Perl (the -T flag) would spot this problem beforehand (tainted data), I think.syslog('info', '%s', $message);
If you're just discarding the input anyway, just call <STDIN> in a void context:
<STDIN>;
In reply to RE: onlyone
by Fastolfe
in thread onlyone
by BoredByPolitics
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |