say() should parse exactly like print()
Rafael Garcia-Suarez [Mon, 26 Mar 2007 13:51:30 +0000 (13:51 +0000)]
p4raw-id: //depot/perl@30760

sv.c
toke.c

diff --git a/sv.c b/sv.c
index 51dffcb..c10eb93 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -11997,6 +11997,7 @@ S_find_uninit_var(pTHX_ OP* obase, SV* uninit_sv, bool match)
 
     case OP_PRTF:
     case OP_PRINT:
+    case OP_SAY:
        /* skip filehandle as it can't produce 'undef' warning  */
        o = cUNOPx(obase)->op_first;
        if ((obase->op_flags & OPf_STACKED) && o->op_type == OP_PUSHMARK)
diff --git a/toke.c b/toke.c
index e4a52e3..935a32a 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -2646,7 +2646,8 @@ S_intuit_method(pTHX_ char *start, GV *gv, CV *cv)
      */
 
     if (*start == '$') {
-       if (gv || PL_last_lop_op == OP_PRINT || isUPPER(*PL_tokenbuf))
+       if (gv || PL_last_lop_op == OP_PRINT || PL_last_lop_op == OP_SAY ||
+               isUPPER(*PL_tokenbuf))
            return 0;
 #ifdef PERL_MAD
        len = start - SvPVX(PL_linestr);