This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add 'strict' subpragma to 'use re'
authorKarl Williamson <khw@cpan.org>
Mon, 5 Jan 2015 20:17:58 +0000 (13:17 -0700)
committerKarl Williamson <khw@cpan.org>
Tue, 13 Jan 2015 19:01:03 +0000 (12:01 -0700)
commit67cdf558540fcb50072632cb50aa953c0583f350
tree82939f4dd1b0c3783defc60226f6b39dda11d87e
parentaf631a26a8f5a7d7136bf909c27dbba1a2d49690
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.
MANIFEST
ext/re/re.pm
ext/re/t/strict.t [new file with mode: 0644]
pod/perldelta.pod
pod/perldiag.pod
pod/perlre.pod
pod/perlrequick.pod
pod/perlretut.pod
regcomp.c
t/re/reg_mesg.t