This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
darwin was failing this test under PERLIO=stdio
[perl5.git] / pad.c
diff --git a/pad.c b/pad.c
index e34faec..9773a25 100644 (file)
--- a/pad.c
+++ b/pad.c
@@ -64,7 +64,7 @@ have C<&PL_padname_const> "names" (see C<L</pad_alloc>>).  That
 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
@@ -1035,11 +1035,12 @@ Perl_pad_findmy_sv(pTHX_ SV *name, U32 flags)
 /*
 =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
 */
@@ -1047,18 +1048,14 @@ L</find_rundefsv> is likely to be more convenient.
 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
 */
@@ -1066,35 +1063,7 @@ or will otherwise be the global one.
 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;
 }
 
 /*
@@ -2334,7 +2303,7 @@ An SV may be passed as a second argument.  If so, the name will be assigned
 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).
 
@@ -2783,7 +2752,7 @@ Perl_padnamelist_dup(pTHX_ PADNAMELIST *srcpad, CLONE_PARAMS *param)
 /*
 =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>>.