This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldiag: Update descr for ‘Switch condition not recognized’
authorFather Chrysostomos <sprout@cpan.org>
Tue, 19 Nov 2013 05:30:45 +0000 (21:30 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 19 Nov 2013 21:00:53 +0000 (13:00 -0800)
commit9f57786ad809c9db4556a0b1b57e6fcde8b8ae0b
tree8e3738b41730702f626d7d716b9234c397f821e6
parent4c99f16d9c16b47be85bbce3942fabfc10f0abbd
perldiag: Update descr for ‘Switch condition not recognized’

Originally, the message ‘Switch (?(number%c not recognized’ only
applied to /(?(1junk))/.  perl-5.6.0-657-gb45f050 changed it to read
‘Switch condition not recognized’.

perl-5.8.0-8771-g0a4db38 added (?(<...>)), (?('...')), (?(DEFINE)) and
(?(R...)).  All of these can trigger that messages if there is junk
before the first closing parenthesis (e.g., /(?(<name>junk))/, causing
a mismatch between the cases where the error occurs and the descrip-
tion in perldiag:

    (F) If the argument to the (?(...)if-clause|else-clause) con-
    struct is a number, it can be only a number.  The <-- HERE shows
    whereabouts in the regular expression the problem was discovered.
    See perlre.

(which itself was already confusingly worded).

Whether these should be changed to use the more standard ‘Unknown
switch condition’ message I don’t want to deal with right now.

In any case, the description is only sometimes relevant, so this com-
mit just copies the description from ‘Unknown switch condition’.
pod/perldiag.pod