The command-line options -s and -F are now recognized on the shebang
(#!) line.
+=item *
+
+Use of the C</c> match modifier without an accompanying C</g> modifier
+elicits a new warning: C<Use of /c modifier is meaningless without /g>.
+
=back
=head1 Modules and Pragmata
(D deprecated) You are now encouraged to use the explicitly quoted form
if you wish to use an empty line as the terminator of the here-document.
+=item Use of /c modifier is meaningless without /g
+
+(W regexp) You used the /c modifier with a regex operand, but didn't
+use the /g modifier. Currently, /c is meaningful only when /g is
+used. (This may change in the future.)
+
=item Use of *glob{FILEHANDLE} is deprecated
(D deprecated) You are now encouraged to use the shorter *glob{IO} form
$a = 0047777777777 ;
dump() better written as CORE::dump()
-
+
+ Use of /c modifier is meaningless without /g
+
Mandatory Warnings
------------------
Use of "%s" without parentheses is ambiguous [check_uni]
"bar" =~ /\_/;
EXPECT
Unrecognized escape \q passed through at - line 4.
+########
+# toke.c
+# 20020328 mjd@plover.com at behest of jfriedl@yahoo.com
+use warnings 'regexp';
+"foo" =~ /foo/c;
+no warnings 'regexp';
+"foo" =~ /foo/c;
+EXPECT
+Use of /c modifier is meaningless without /g at - line 4.
+########
+# toke.c
+# 20020328 mjd@plover.com at behest of jfriedl@yahoo.com
+use warnings 'regexp';
+$_ = "ab" ;
+s/ab/ab/c;
+no warnings 'regexp';
+s/ab/ab/c;
+EXPECT
+Use of /c modifier is meaningless without /g at - line 5.
#define yylval PL_yylval
static char ident_too_long[] = "Identifier too long";
+static char c_without_g[] = "Use of /c modifier is meaningless without /g";
static void restore_rsfp(pTHX_ void *f);
#ifndef PERL_NO_UTF16_FILTER
while (*s && strchr("iogcmsx", *s))
pmflag(&pm->op_pmflags,*s++);
}
+ /* issue a warning if /c is specified,but /g is not */
+ if (ckWARN(WARN_REGEXP) &&
+ (pm->op_pmflags & PMf_CONTINUE) && !(pm->op_pmflags & PMf_GLOBAL))
+ {
+ Perl_warner(aTHX_ packWARN(WARN_REGEXP), c_without_g);
+ }
+
pm->op_pmpermflags = pm->op_pmflags;
PL_lex_op = (OP*)pm;
break;
}
+ /* issue a warning if /c is specified,but /g is not */
+ if (ckWARN(WARN_REGEXP) &&
+ (pm->op_pmflags & PMf_CONTINUE) && !(pm->op_pmflags & PMf_GLOBAL))
+ {
+ Perl_warner(aTHX_ packWARN(WARN_REGEXP), c_without_g);
+ }
+
if (es) {
SV *repl;
PL_sublex_info.super_bufptr = s;