diff options
author | Karl Williamson <khw@khw-desktop.(none)> | 2010-06-09 14:40:14 -0600 |
---|---|---|
committer | David Golden <dagolden@cpan.org> | 2010-06-18 18:43:03 -0400 |
commit | e6897b1a5db0410e387ccbf677e89fc4a1d8c97a (patch) | |
tree | 6bde58df5125be7b350ea94874255b04b1f053ea /toke.c | |
parent | d9bf0e0a91525fcdd8099d78b891aa20066e9d1c (diff) | |
download | perl-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.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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); |