1753768 Members
5082 Online
108799 Solutions
New Discussion

Syslog.pm - abnormal end

 
Igor I. Shulz
Frequent Advisor

Syslog.pm - abnormal end

Hello, world

I have perl-script (perl 5.8.1), that works as dettached (daemonized) process under Mandrake 9.2. In fact it is some kind of tcp-server for some service. As server it writes log to syslog thru Syslog.pm.

It works fine without interruption day by day but sometime it dies with message:

Modification of a read-only value attempted at /usr/lib/perl5/5.8.1/i386-linux-thread-multi/Sys/Syslog.pm line 302.

Why??? This is source of Syslog.pm:

sub syslog {
local($priority) = shift;
local($mask) = shift;
local($message, $whoami);
local(@words, $num, $numpri, $numfac, $sum);
local($facility) = $facility; # may need to change temporarily.
............................................
$whoami .= "[$$]" if $lo_pid;

$mask =~ s/%m/$!/g;
$mask .= "\n" unless $mask =~ /\n$/;
$message = sprintf ($mask, @_);


Line 302 is : $message = sprintf ($mask, @_);

What is the problem? Why $message became read-only value?

Thank you

--Igor