in reply to How best to see if syslogd is running?

It looks to me like the problem with your code is it's missing a trailing pipe. If I use:
my $cmd="ps -ef |grep -v grep |grep `cat /var/run/syslogd.pid` |"
it works.

A smarter solution would make sure that the PID running was actually syslog, in case syslogd died and another process started with the same PID:

my $cmd = "ps -ef |grep -v grep |grep `cat /var/run/syslogd.pid` |grep syslogd |"

One of the modules that acts as a frontend to ps is what you really want, though (see the other responses).