--- Devel-FindRef/FindRef.xs 2007/12/29 21:04:46 1.6 +++ Devel-FindRef/FindRef.xs 2008/04/26 03:15:28 1.7 @@ -16,7 +16,9 @@ { \ AV *av = newAV (); \ av_push (av, newSVpv (text, 0)); \ + if (rmagical) SvRMAGICAL_on (sv); \ av_push (av, sv_rvweaken (newRV_inc (sv))); \ + if (rmagical) SvRMAGICAL_off (sv); \ av_push (about, newRV_noinc ((SV *)av)); \ } @@ -119,6 +121,9 @@ { int depth = CvDEPTH (sv); + if (!depth && CvPADLIST(sv)) + depth = 1; + if (depth) { AV *padlist = CvPADLIST (sv); @@ -129,13 +134,16 @@ av_push (excl, newSVuv (PTR2UV (pad))); /* exclude pads themselves from being found */ - for (i = AvFILLp (pad); i--; ) + for (i = AvFILLp (pad) + 1; i--; ) if (AvARRAY (pad)[i] == targ) res_pair (form ("in the lexical '%s' in", SvPVX (AvARRAY (AvARRAY (padlist)[0])[i]))); --depth; } } + + if ((SV*)CvOUTSIDE(sv) == targ) + res_pair ("the containing scope for"); } break;