summaryrefslogtreecommitdiff
path: root/pod/perlrequick.pod
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2015-01-05 13:17:58 -0700
committerKarl Williamson <khw@cpan.org>2015-01-13 12:01:03 -0700
commit67cdf558540fcb50072632cb50aa953c0583f350 (patch)
tree82939f4dd1b0c3783defc60226f6b39dda11d87e /pod/perlrequick.pod
parentaf631a26a8f5a7d7136bf909c27dbba1a2d49690 (diff)
downloadperl-67cdf558540fcb50072632cb50aa953c0583f350.tar.gz
Add 'strict' subpragma to 'use re'
This subpragma is to allow p5p to add warnings/errors for regex patterns without having to worry about backwards compatibility. And it allows users who want to have the latest checks on their code to do so. An experimental warning is raised by default when it is used, not because the subpragma might go away, but because what it catches is subject to change from release-to-release, and so the user is acknowledging that they waive the right to backwards compatibility. I will be working in the near term to make some changes to what is detected by this. Note that there is no indication in the pattern stringification that it was compiled under this. This means I didn't have to figure out how to stringify it. It is fine because using this doesn't affect what the pattern gets compiled into, if successful. And interpolating the stringified pattern under either strict or non-strict should both just work.
Diffstat (limited to 'pod/perlrequick.pod')
-rw-r--r--pod/perlrequick.pod8
1 files changed, 8 insertions, 0 deletions
diff --git a/pod/perlrequick.pod b/pod/perlrequick.pod
index 008ef339fe..30c3238a9f 100644
--- a/pod/perlrequick.pod
+++ b/pod/perlrequick.pod
@@ -495,6 +495,14 @@ the matched substrings from the groupings as well:
Since the first character of $x matched the regex, C<split> prepended
an empty initial element to the list.
+=head2 C<use re 'strict'>
+
+New in v5.22, this applies stricter rules than otherwise when compiling
+regular expression patterns. It can find things that, while legal, may
+not be what you intended.
+
+See L<'strict' in re|re/'strict' mode>.
+
=head1 BUGS
None.