<p>Has anyone got <a href="http://perldoc.perl.org/Sys/Syslog.html" rel="nofollow noreferrer">Sys::Syslog</a> to work on Solaris?  (I'm running Sys::Syslog 0.05 on Perl v5.8.4 on SunOS 5.10 on SPARC).  Here's what doesn't work for me:</p>

<pre><code>openlog "myprog", "pid", "user" or die;
syslog "crit", "%s", "Test from $0" or die;
closelog() or warn "Can't close: $!";
system "tail /var/adm/messages";
</code></pre>

<p>Whatever I do, the closelog returns an error and nothing ever gets logged anywhere.</p>

[{'answer_id': 68121, 'author': 'rjbs', 'author_id': 10478, 'author_profile': 'https://Stackoverflow.com/users/10478', 'pm_score': 2, 'selected': False, 'text': "<p>By default, Sys::Syslog is going to try to connect with one of the following socket types:</p>\n\n<pre><code>[ 'tcp', 'udp', 'unix', 'stream' ]\n</code></pre>\n\n<p>On Solaris, though, you'll need to use an inet socket.  Call:</p>\n\n<pre><code>setlogsock('inet', $hostname);\n</code></pre>\n\n<p>and things should start working.</p>\n"}, {'answer_id': 81450, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<p>setlogsock(\'inet\') didn\'t do it for me (it looks for host "syslog") but building and installing Sys::Syslog from CPAN did.  The Sys::Syslog that comes with Solaris 10 is ancient.</p>\n'}, {'answer_id': 81499, 'author': 'moritz', 'author_id': 14132, 'author_profile': 'https://Stackoverflow.com/users/14132', 'pm_score': 1, 'selected': False, 'text': '<p>In general you can answer "does module $x work on platform $y" questions by looking at the CPAN testers matrix, <a href="http://bbbike.radzeit.de/~slaven/cpantestersmatrix.cgi?dist=Sys-Syslog+0.26" rel="nofollow noreferrer">like here</a>.</p>\n'}]
['https://Stackoverflow.com/questions/67760', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']