turn $a.=<F> into an RCATLINE
authorAbhijit Menon-Sen <ams@wiw.org>
Sat, 11 Aug 2001 16:31:04 +0000 (22:01 +0530)
committerJarkko Hietaniemi <jhi@iki.fi>
Sat, 11 Aug 2001 14:59:22 +0000 (14:59 +0000)
Message-ID: <20010811163104.Q526@lustre.dyn.wiw.org>

p4raw-id: //depot/perl@11634

op.c

diff --git a/op.c b/op.c
index 52fd74d..b9b7869 100644 (file)
--- a/op.c
+++ b/op.c
@@ -6882,6 +6882,15 @@ Perl_peep(pTHX_ register OP *o)
                                SvPV_nolen(sv));
                }
            }
+           else if (o->op_next->op_type == OP_READLINE
+                   && o->op_next->op_next->op_type == OP_CONCAT
+                   && (o->op_next->op_next->op_flags & OPf_STACKED))
+           {
+               /* Turn "$a .= <FH>" into an OP_RCATLINE. AMS 20010811 */
+               o->op_next->op_type   = OP_RCATLINE;
+               o->op_next->op_flags |= OPf_STACKED;
+               op_null(o->op_next->op_next);
+           }
 
            o->op_seq = PL_op_seqmax++;
            break;