summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2011-02-21 09:57:51 -0700
committerKarl Williamson <public@khwilliamson.com>2011-02-21 10:21:04 -0700
commitaeac89a5cf53bb9960c234ce5eb2edec45240539 (patch)
treead76105a25ee1877017ed305ce2bb4dad4ff6e5e /toke.c
parent563734a5c4b4f703e42b464212780e9324e7e050 (diff)
downloadperl-aeac89a5cf53bb9960c234ce5eb2edec45240539.tar.gz
toke.c: 'Specialized /le message is only for substitutes
m//le has to be the lexical comparison, so use the generic deprecation for that case
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/toke.c b/toke.c
index f7f08492af..380722aba9 100644
--- a/toke.c
+++ b/toke.c
@@ -8798,6 +8798,14 @@ S_pmflag(pTHX_ const char* const valid_flags, U32 * pmfl, char** s) {
goto deprecate;
}
else if (*((*s) + 1) == 'e' && ! isALNUM(*((*s) + 2))) {
+
+ /* 'e' is valid only for substitutes, s///e. If it is not
+ * valid in the current context, then 'm//le' must mean the
+ * comparison operator, so use the regular deprecation message.
+ */
+ if (! strchr(valid_flags, 'e')) {
+ goto deprecate;
+ }
Perl_ck_warner_d(aTHX_ packWARN(WARN_AMBIGUOUS),
"Ambiguous use of 's//le...' resolved as 's// le...'; Rewrite as 's//el' if you meant 'use locale rules and evaluate rhs as an expression'. In Perl 5.16, it will be resolved the other way");
return FALSE;