This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
From Craig Berry, following the example of the other podxxx.PL
[perl5.git] / gv.c
diff --git a/gv.c b/gv.c
index 8a9b803..2fe604b 100644 (file)
--- a/gv.c
+++ b/gv.c
@@ -761,12 +761,15 @@ Perl_gv_fetchpv(pTHX_ const char *nambeg, I32 add, I32 sv_type)
 
     if (!stash) {
        if (add) {
-           qerror(Perl_mess(aTHX_
+           register SV *err = Perl_mess(aTHX_
                 "Global symbol \"%s%s\" requires explicit package name",
                 (sv_type == SVt_PV ? "$"
                  : sv_type == SVt_PVAV ? "@"
                  : sv_type == SVt_PVHV ? "%"
-                 : ""), name));
+                 : ""), name);
+           if (USE_UTF8_IN_NAMES)
+               SvUTF8_on(err);
+           qerror(err);
            stash = GvHV(gv_fetchpv("<none>::", GV_ADDMULTI, SVt_PVHV));
        }
        else