summaryrefslogtreecommitdiff
path: root/doop.c
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2002-10-09 19:17:08 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2002-10-09 19:17:08 +0000
commitd59e14dbffe53a28b0845a7d6b4250babf9e83ac (patch)
treee87993a60fdd580672ebf43813fbdca6dbf79e81 /doop.c
parentcb23e6a442dc2c0b012e000464ec63c7cf4171fa (diff)
downloadperl-d59e14dbffe53a28b0845a7d6b4250babf9e83ac.tar.gz
Fix bug #17823 : non-modifying tr/// stringifies references
p4raw-id: //depot/perl@17984
Diffstat (limited to 'doop.c')
-rw-r--r--doop.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/doop.c b/doop.c
index a8d1672048..20dc68b868 100644
--- a/doop.c
+++ b/doop.c
@@ -608,10 +608,11 @@ Perl_do_trans(pTHX_ SV *sv)
(void)SvPV(sv, len);
if (!len)
return 0;
- if (!SvPOKp(sv))
- (void)SvPV_force(sv, len);
- if (!(PL_op->op_private & OPpTRANS_IDENTICAL))
+ if (!(PL_op->op_private & OPpTRANS_IDENTICAL)) {
+ if (!SvPOKp(sv))
+ (void)SvPV_force(sv, len);
(void)SvPOK_only_UTF8(sv);
+ }
DEBUG_t( Perl_deb(aTHX_ "2.TBL\n"));