It's perfectly legal to call sys::syslog with a format having NO 
variable placeholders and therefore an empty @args parameter.

Your rewrite will break all calls that do use substitution.

You may want to try rewriting these lines instead as 
 syslog ('err', "error trying to recv a trap: %m");
although the whole thing still sounds like a bug to me ...

--Peter

-----Original Message-----
From: zalktis@yahoo.com [mailto:zalktis@yahoo.com]
Sent: Thursday, September 29, 2005 15:09
To: mon@linux.kernel.org
Subject: mon - Sys::Syslog::syslog usage

Hi,

There are many lines in mon source like this:
 syslog ('err', "error trying to recv a trap: $!");

On other hand, Sys::Syslog documentation states, that
syslog() syntax is:
----------------------------------------------------
syslog $priority, $format, @args
    If $priority permits, logs ($format, @args) printed as
by printf(3V), with the addition that %m is replaced with
"$!" (the latest error message).
----------------------------------------------------
In our installation it sometimes crashes mon with the last
message in 'monerrfile':
Modification of a read-only value attempted at
/usr/lib/perl5/5.8.5/i586-linux-thread-multi/Sys/Syslog.pm
line 312.

Possible solution (but I'm not sure) is to overload
subroutine 'syslog' in 'mon':
---------------------------
sub syslog; 
....
sub syslog{
 my ($pri,$msg)=(shift,shift);
 Sys::Syslog::syslog($pri,'%s',$msg)
}
---------------------------

Perl version: v5.8.5 built for i586-linux-thread-multi
Sys::Syslog version 0.05

Any comments?

TIA,
zalktis

Z.
http://zalktis.from.lv

		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

_______________________________________________
mon mailing list
mon@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/mon