summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@khw-desktop.(none)>2010-06-09 14:40:14 -0600
committerDavid Golden <dagolden@cpan.org>2010-06-18 18:43:03 -0400
commite6897b1a5db0410e387ccbf677e89fc4a1d8c97a (patch)
tree6bde58df5125be7b350ea94874255b04b1f053ea /toke.c
parentd9bf0e0a91525fcdd8099d78b891aa20066e9d1c (diff)
downloadperl-e6897b1a5db0410e387ccbf677e89fc4a1d8c97a.tar.gz
Deprecate no space between pattern, following word
This patch raises a deprecated warning on constructs like $result = $a =~ m/$foo/sand $bar; which means $result = $a =~ m/$foo/s and $bar;
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/toke.c b/toke.c
index daa60a18ed..a94753a0b8 100644
--- a/toke.c
+++ b/toke.c
@@ -11887,6 +11887,12 @@ S_scan_pat(pTHX_ char *start, I32 type)
#endif
while (*s && strchr(valid_flags, *s))
pm->op_pmflags = S_pmflag(pm->op_pmflags, *s++);
+
+ if (isALNUM(*s)) {
+ Perl_ck_warner_d(aTHX_ packWARN(WARN_SYNTAX),
+ "Having no space between pattern and following word is deprecated");
+
+ }
#ifdef PERL_MAD
if (PL_madskills && modstart != s) {
SV* tmptoken = newSVpvn(modstart, s - modstart);