[perl #115818] Don’t croak for /[.zog.]/
authorFather Chrysostomos <sprout@cpan.org>
Tue, 4 Dec 2012 19:04:24 +0000 (11:04 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 4 Dec 2012 22:33:30 +0000 (14:33 -0800)
commitf5eec17cdc8138641bd75afb9c79295f9bbecde3
tree9564c22e8c6a5778fdc4f88894f962def489b8b8
parentb15b9c2a4267eed1abe5a08e57b250f7fab2e9f9
[perl #115818] Don’t croak for /[.zog.]/

/[.zog.]/ produces a warning, because the POSIX syntax is not used
correctly.  It must be /[[.zog.]]/.

/[[.zog.]]/ croaks, because that POSIX syntax has not been imple-
mented yet.

There is currently a croak for the former, too, even though it is
the latter syntax that is forbidden.  There is no reason to forbid
the former.

The reason for warning is that /[.zog.]/ is a regular character
class (equivalent to [.zog]), so it might not do what the programmer
intended.  If that is why we warn, it doesn’t make sense to croak.
After all, perl is only guessing that the programmer *might* have made
a mistake.

This makes /[.foo.]/ similar to /[:foo:]/, which warns and then acts
like /[:fo]/.
regcomp.c
t/lib/warnings/regcomp