my $pidfile = "/var/run/syslogd.pid"; if (-e $pidfile && qx "cat /proc/`cat $pidfile`/cmdline" =~ /^syslogd$/) { ... syslog is running ... }