Introduce (undefined) pthread_attr_setscope to non-Configure lands.
[p5sagit/p5-mst-13.2.git] / pp.c
diff --git a/pp.c b/pp.c
index 1243766..ef8a37d 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -1,6 +1,7 @@
 /*    pp.c
  *
- *    Copyright (c) 1991-2003, Larry Wall
+ *    Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+ *    2000, 2001, 2002, 2003, by Larry Wall and others
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
@@ -106,6 +107,9 @@ PP(pp_padhv)
     }
     else if (gimme == G_SCALAR) {
        SV* sv = sv_newmortal();
+        if (SvRMAGICAL(TARG) && mg_find(TARG, PERL_MAGIC_tied))
+            Perl_croak(aTHX_ "Can't provide tied hash usage; "
+                       "use keys(%%hash) to test if empty");
        if (HvFILL((HV*)TARG))
            Perl_sv_setpvf(aTHX_ sv, "%ld/%ld",
                      (long)HvFILL((HV*)TARG), (long)HvMAX((HV*)TARG) + 1);
@@ -590,8 +594,12 @@ PP(pp_gelem)
            sv = newSVpvn(GvNAME(gv), GvNAMELEN(gv));
        break;
     case 'P':
-       if (strEQ(elem, "PACKAGE"))
-           sv = newSVpv(HvNAME(GvSTASH(gv)), 0);
+        if (strEQ(elem, "PACKAGE")) {
+            if (HvNAME(GvSTASH(gv)))
+                sv = newSVpv(HvNAME(GvSTASH(gv)), 0);
+            else
+                sv = newSVpv("__ANON__",0);
+        }
        break;
     case 'S':
        if (strEQ(elem, "SCALAR"))