Elizabeth Mattijsen wrote:
At 12:20 -0800 11/15/03, Stas Bekman wrote:

Juanma Barranquero wrote:

  [Sat Nov 15 17:39:17 2003] [error] [client 127.0.0.1] Modification of
  a read-only value attempted at C:/bin/Perl/lib/Config.pm line 75.
  , referer: http://localhost/perl-status

Yup, confirmed, that's a bug in perl:


% perl-5.8.1-ithread -le 'use threads; require Config; \
threads->new(sub { })->detach; print Config::myconfig()'
Modification of a read-only value attempted at /home/stas/perl/5.8.1-ithread/lib/5.8.1/i686-linux-thread-multi/Config.pm line 88.


One of which I am guilty, I'm afraid. This was one of the memory saving fixes I submitted for 5.8.1. To fix this with 5.8.1 and 5.8.2, please add the following code to your program (or to Apache::Status possibly?):

use Config;
BEGIN {
    if ($Config::Config{useithreads} and $] > 5.008 and $] < 5.008003) {
        no strict 'refs';
        no warnings 'redefine';
        sub Config::myconfig {
            return $Config::summary_expanded if $Config::summary_expanded;
            ($Config::summary_expanded = $Config::summary) =~ s{\$(\w+)}
                 { my $c = $Config{$1}; defined($c) ? $c : 'undef' }ge;
            $Config::summary_expanded;
        } #Config::myconfig
    }
}

Thanks a lot, Liz. I've committed a similar local workaround, without redefining Config::myconfig.


This code should resolve the issue for 5.8.1 and 5.8.2. I'll supply patches for 5.8.3 to p5p.

Great! It'd be nice to have this tested as well under threads ;)


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to