diff options
author | reneeb <unknown> | 2008-11-16 22:13:57 -0800 |
---|---|---|
committer | Steve Peters <steve@fisharerojo.org> | 2008-11-25 03:51:41 +0000 |
commit | b08e453b5ad23d251311b831812c303bc4595012 (patch) | |
tree | c1370a4731e75dc069a28cb35218d24f0cd17e65 /op.c | |
parent | 8226a3d7ea7a9414bc41d73011d23876bd55e4b8 (diff) | |
download | perl-b08e453b5ad23d251311b831812c303bc4595012.tar.gz |
[perl #7911] no warning for useless /d in tr/0-9//d
From: "reneeb via RT" <perlbug-followup@perl.org>
Message-ID: <rt-3.6.HEAD-10965-1226931231-1833.7911-15-0@perl.org>
p4raw-id: //depot/perl@34905
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -3451,6 +3451,15 @@ Perl_pmtrans(pTHX_ OP *o, OP *expr, OP *repl) } } } + + if(ckWARN(WARN_MISC)) { + if(del && rlen == tlen) { + Perl_warner(aTHX_ packWARN(WARN_MISC), "Useless use of /d modifier in transliteration operator"); + } else if(rlen > tlen) { + Perl_warner(aTHX_ packWARN(WARN_MISC), "Replacement list is longer than search list"); + } + } + if (grows) o->op_private |= OPpTRANS_GROWS; #ifdef PERL_MAD |