in reply to Is syslog already open?

Since openlog() croaks if it can't connect to the syslog daemon, you could just use fileno on the socket filehandle openlog() uses:
#!/usr/bin/perl use strict; use Sys::Syslog; sub is_open { defined fileno(*Sys::Syslog::SYSLOG) } print "opened? ",is_open() ? 'yes' : 'no', "\n"; print "calling openlog()\n"; openlog("perl","ndelay","LOG_LOCAL0") or die; print "opened? ",is_open() ? 'yes' : 'no', "\n"; __END__ opened? no calling openlog() opened? yes

If the filehandle is closed, fileno returns undef. Of course it would be nice if that were inside Sys::Syslog and the filehandle wouldn't be accessible from outside.

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}