diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2001-04-07 11:52:40 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2001-04-07 11:52:40 +0000 |
commit | c26ea50d9fd947ede98c9a5c8c05ff72fc15deaa (patch) | |
tree | 3ab7d3306e1da56cbad2ff9f361bc011f5ecbe8a | |
parent | 138f1810fbcb108e34b435101364ce91355912ad (diff) | |
download | perl-c26ea50d9fd947ede98c9a5c8c05ff72fc15deaa.tar.gz |
can't optimize away scope entry if tr/// is present
p4raw-id: //depot/maint-5.6/perl@9605
-rw-r--r-- | op.c | 1 | ||||
-rwxr-xr-x | t/op/tr.t | 10 |
2 files changed, 10 insertions, 1 deletions
@@ -2635,6 +2635,7 @@ Perl_pmtrans(pTHX_ OP *o, OP *expr, OP *repl) I32 grows = 0; register short *tbl; + PL_hints |= HINT_BLOCK_SCOPE; complement = o->op_private & OPpTRANS_COMPLEMENT; del = o->op_private & OPpTRANS_DELETE; squash = o->op_private & OPpTRANS_SQUASH; @@ -5,7 +5,7 @@ BEGIN { @INC = '../lib'; } -print "1..52\n"; +print "1..54\n"; $_ = "abcdefghijklmnopqrstuvwxyz"; @@ -301,3 +301,11 @@ print "ok 51\n"; ($a = "R0_001") =~ tr/R_//d; print "not " if hex($a) != 1; print "ok 52\n"; + +@a = (1,2); map { y/1/./ for $_ } @a; +print "not " if "@a" ne ". 2"; +print "ok 53\n"; + +@a = (1,2); map { y/1/./ for $_.'' } @a; +print "not " if "@a" ne "1 2"; +print "ok 54\n"; |