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

Change of constant/%:: behavior between 5.8.8 and 5.10.0

Thread Next
From:
Michael G Schwern
Date:
October 28, 2008 16:46
Subject:
Change of constant/%:: behavior between 5.8.8 and 5.10.0
Message ID:
4907A40A.70609@pobox.com
mixin.pm seems to tickle a change between the value of a constant subroutine
on the symbol table.

With constant.pm 1.13 & 1.15
perl5.10.0 -wle 'use constant FOO => "bar";  print $main::{FOO}'
SCALAR(0x181dce0)

With constant.pm 1.15
perl5.8.8 -wle 'use constant FOO => "bar";  print $main::{FOO}'
*main::FOO

This changes breaks the following code in mixin.pm.

    local *glob;
    while( my($sym, $glob) = each %{$mixin.'::'}) {
        next if $sym =~ /^_/;
        next unless defined $glob;
        *glob = $glob;   # XXX AT THIS LINE
        *{$pkg.'::'.$sym} = *glob{CODE} if *glob{CODE};
    }

I don't know if it's a bug or not, but it's kind of weird to find a scalar ref
on the symbol table.


-- 
91. I am not authorized to initiate Jihad.
    -- The 213 Things Skippy Is No Longer Allowed To Do In The U.S. Army
           http://skippyslist.com/list/


Thread Next


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