perlfunc.pod grammar fixes
[p5sagit/p5-mst-13.2.git] / pp_hot.c
index 35558f1..8298026 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1611,8 +1611,8 @@ Perl_do_readline(pTHX)
             const STRLEN len = SvCUR(sv) - offset;
             const U8 *f;
             
-            if (!Perl_is_utf8_string_loc(aTHX_ s, len, &f)
-               && ckWARN(WARN_UTF8))
+            if (ckWARN(WARN_UTF8) &&
+                   !Perl_is_utf8_string_loc(aTHX_ s, len, &f))
                  /* Emulate :encoding(utf8) warning in the same case. */
                  Perl_warner(aTHX_ packWARN(WARN_UTF8),
                              "utf8 \"\\x%02X\" does not map to Unicode",
@@ -2441,7 +2441,10 @@ PP(pp_leavesublv)
            MARK = newsp + 1;
            EXTEND_MORTAL(1);
            if (MARK == SP) {
-               if (SvFLAGS(TOPs) & (SVs_TEMP | SVs_PADTMP | SVf_READONLY)) {
+               /* Temporaries are bad unless they happen to be elements
+                * of a tied hash or array */
+               if (SvFLAGS(TOPs) & (SVs_TEMP | SVs_PADTMP | SVf_READONLY) &&
+                   !(SvRMAGICAL(TOPs) && mg_find(TOPs, PERL_MAGIC_tiedelem))) {
                    LEAVE;
                    cxstack_ix--;
                    POPSUB(cx,sv);