diff options
author | Karl Williamson <public@khwilliamson.com> | 2011-02-21 09:57:51 -0700 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2011-02-21 10:21:04 -0700 |
commit | aeac89a5cf53bb9960c234ce5eb2edec45240539 (patch) | |
tree | ad76105a25ee1877017ed305ce2bb4dad4ff6e5e /toke.c | |
parent | 563734a5c4b4f703e42b464212780e9324e7e050 (diff) | |
download | perl-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.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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; |