develooper Front page | perl.perl5.porters | Postings from October 1999

[ID 19991005.004] problems in Sys::Syslog and stdarg.ph

From:
richard
Date:
October 5, 1999 10:39
Subject:
[ID 19991005.004] problems in Sys::Syslog and stdarg.ph
Message ID:
19991005173942.28128.qmail@tmtowtdi.perl.org

OS: Linux 2.2.10 (RedHat-6.0)
Perl: 5.005_03 (perl-5.00503-2.i386.rpm)


I found two problems with Sys::Syslog:

(1) There's an error in stdarg.ph, required by Syslog.pm:

    Constant subroutine __need___va_list undefined at /usr/lib/perl5/5.00503/i386-linux/stdarg.ph line 9.

    The answer is to comment out line 9 by hand

ed /usr/lib/perl5/5.00503/i386-linux/stdarg.ph <<EOF
9 s/^/#/
wq
EOF

(2) Sys::Syslog also doesn't seem to work unless you use
    setlogsock('unix').  That tells it to use the syslog unix domain
    socket, instead of the default inet (UDP or TCP) socket.

Here's my test program which works (after editing stdarg.ph):

#! /usr/bin/perl -w

use Sys::Syslog qw(:DEFAULT setlogsock);

setlogsock('unix');
openlog("Sys::Syslog", "cons,pid", "user");
syslog("info", "testing syslog at %s", scalar(localtime()));
closelog();

--Noel




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About