On Tue, Nov 17, 2009 at 6:22 PM, Eric Brine <ikegami@adaelis.com> wrote: > On Tue, Nov 17, 2009 at 2:27 PM, David Nicol <davidnicol@gmail.com> wrote: > >> 2: can TARG be a weak reference using current weak reference technology? >> > That was mentioned earlier in this thread, and seems from a high and >> distant >> level to be the way to go. >> > > Yes, I believe so. > No, I was wrong. Conditions that must be met: - A magical var (e.g. PVLV) must be returned. - The magical var cannot be a TEMP - The magical var must reference the arg var - The magical var must have a counted reference to the arg var. If the TARG is a PLVL that targets an RV that weekly references the arg var, it violates the fourth point causing the following to fail: my $r; { my $s = ""; $r = \substr($s, 0, 1); } $$r = 'a'; print $$r; If the TARG is an RV that weekly references a PVLV that references the arg var, the PVLV would be a TEMP. That violates the second causing the following to fail: sub :lvalue { my $s = ""; substr($s, 0, 1) }->();Thread Previous | Thread Next