in reply to Re: typeglob reference deletes global lexical
in thread typeglob reference deletes global lexical

the typeglob is created, but it doesn't contain anything.

It's not empty. It caches the SUPER(T2::s1)T1::s1 relation.

{ package T1; sub s1 { } } { package T2; use base T1; } { package T3; use base T2; sub s1 { shift->SUPER::s1 } } use Devel::Peek qw( Dump ); { warn("T1::s1: ", \&T1::s1, "\n"); warn("T2::s1 (pre):\n"); Dump(*T2::s1); T3->s1; warn("T2::s1 (post):\n"); Dump(*T2::s1); }
>perl script.pl 2>&1 | findstr ": CODE CV" T1::s1: CODE(0x183180c) T2::s1 (pre): CV = 0x0 CVGEN = 0x0 T2::s1 (post): CV = 0x183180c CVGEN = 0x91

SUPER doesn't need to be explicitly mentioned.

{ package T1; sub s1 { } } { package T2; use base T1; } use Devel::Peek qw( Dump ); { warn("T1::s1: ", \&T1::s1, "\n"); warn("T2::s1 (pre):\n"); Dump(*T2::s1); T2->s1; warn("T2::s1 (post):\n"); Dump(*T2::s1); }
>perl script.pl 2>&1 | findstr ": CODE CV" T1::s1: CODE(0x183180c) T2::s1 (pre): CV = 0x0 CVGEN = 0x0 T2::s1 (post): CV = 0x183180c CVGEN = 0x8e

Replies are listed 'Best First'.
Re^3: typeglob reference deletes global lexical (SUPER:: cache)
by robnagler (Novice) on Nov 08, 2008 at 03:42 UTC

    I've been trying to narrow this down, and it does get pretty weird. I've got it to the point of calling a closure causes the failure, and if the file lexical is read before the closure call, it doesn't disappear.

    Since I can't reproduce it outside mod_perl (1.x, btw), I suspect this has little to do with typeglobs so sorry for the confusing subject.

    I've got my workaround so I'm going to call it quits on reducing the code to a reproducible failure.

    Rob