C<&PL_padname_undef>
and C<&PL_padname_const> are used is an implementation detail subject to
change. To test for them, use C<!PadnamePV(name)> and
-C<PadnamePV(name) && !PadnameLEN(name)>, respectively.
+S<C<PadnamePV(name) && !PadnameLEN(name)>>, respectively.
Only C<my>/C<our> variable slots get valid names.
The rest are op targets/GVs/constants which are statically allocated
/*
=for apidoc Amp|PADOFFSET|find_rundefsvoffset
-Find the position of the lexical C<$_> in the pad of the
-currently-executing function. Returns the offset in the current pad,
-or C<NOT_IN_PAD> if there is no lexical C<$_> in scope (in which case
-the global one should be used instead).
-L</find_rundefsv> is likely to be more convenient.
+Until the lexical C<$_> feature was removed, this function would
+find the position of the lexical C<$_> in the pad of the
+currently-executing function and returns the offset in the current pad,
+or C<NOT_IN_PAD>.
+
+Now it always returns C<NOT_IN_PAD>.
=cut
*/
PADOFFSET
Perl_find_rundefsvoffset(pTHX)
{
- PADNAME *out_pn;
- int out_flags;
- return pad_findlex("$_", 2, 0, find_runcv(NULL), PL_curcop->cop_seq, 1,
- NULL, &out_pn, &out_flags);
+ PERL_UNUSED_CONTEXT; /* Can we just remove the pTHX from the sig? */
+ return NOT_IN_PAD;
}
/*
=for apidoc Am|SV *|find_rundefsv
-Find and return the variable that is named C<$_> in the lexical scope
-of the currently-executing function. This may be a lexical C<$_>,
-or will otherwise be the global one.
+Returns the global variable C<$_>.
=cut
*/
SV *
Perl_find_rundefsv(pTHX)
{
- PADNAME *name;
- int flags;
- PADOFFSET po;
-
- po = pad_findlex("$_", 2, 0, find_runcv(NULL), PL_curcop->cop_seq, 1,
- NULL, &name, &flags);
-
- if (po == NOT_IN_PAD || PadnameIsOUR(name))
- return DEFSV;
-
- return PAD_SVl(po);
-}
-
-SV *
-Perl_find_rundefsv2(pTHX_ CV *cv, U32 seq)
-{
- PADNAME *name;
- int flags;
- PADOFFSET po;
-
- PERL_ARGS_ASSERT_FIND_RUNDEFSV2;
-
- po = pad_findlex("$_", 2, 0, cv, seq, 1,
- NULL, &name, &flags);
-
- if (po == NOT_IN_PAD || PadnameIsOUR(name))
- return DEFSV;
-
- return AvARRAY(PadlistARRAY(CvPADLIST(cv))[CvDEPTH(cv)])[po];
+ return DEFSV;
}
/*
to it and it will be returned. Otherwise the returned SV will be a new
mortal.
-If C<flags> include C<CV_NAME_NOTQUAL>, then the package name will not be
+If C<flags> has the C<CV_NAME_NOTQUAL> bit set, then the package name will not be
included. If the first argument is neither a CV nor a GV, this flag is
ignored (subject to change).
/*
=for apidoc newPADNAMEpvn
-Constructs and returns a new pad name. C<s> must be a UTF8 string. Do not
+Constructs and returns a new pad name. C<s> must be a UTF-8 string. Do not
use this for pad names that point to outer lexicals. See
C<L</newPADNAMEouter>>.