This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldelta: Note Perl version of regexp_pattern()
[perl5.git] / pod / perldiag.pod
index 9d4451f..c6806c1 100644 (file)
@@ -115,7 +115,7 @@ please write C<$foo[2]>, or you might have meant to pass an anonymous
 arrayref to the function named foo, then do a scalar deref on the
 value it returns.  If you meant that, write C<${foo([2])}>.
 
-=item Ambiguous use of -%s resolved as -&%s() at - line 3.
+=item Ambiguous use of -%s resolved as -&%s()
 
 (W ambiguous) You wrote something like C<-foo>, which might be the
 string C<"-foo"> (outside of C<use strict 'subs'>), or a call to the
@@ -2241,6 +2241,15 @@ colon or whitespace was seen between the elements of a layer list.
 If the previous attribute had a parenthesised parameter list, perhaps that
 list was terminated too soon.
 
+=item Invalid strict version format (%s)
+
+(F)  A version number did not meet the "strict" criteria for versions.
+A "strict" version number is a positive decimal number (integer or
+decimal-fraction) without exponentiation or else a dotted-decimal
+v-string with a leading 'v' character and at least three components.
+The parenthesized text indicates which criteria were not met.
+See the L<version> module for more details on allowed version formats.
+
 =item Invalid type '%s' in %s
 
 (F) The given character is not a valid pack or unpack type.
@@ -2248,16 +2257,24 @@ See L<perlfunc/pack>.
 (W) The given character is not a valid pack or unpack type but used to be
 silently ignored.
 
-=item Invalid version format (multiple underscores)
+=item Invalid version format (%s)
 
-(F) Versions may contain at most a single underscore, which signals
-that the version is a beta release.  See L<version> for the allowed
-version formats.
+(F)  A version number did not meet the "lax" criteria for versions.
+A "lax" version number is a positive decimal number (integer or
+decimal-fraction) without exponentiation or else a dotted-decimal
+v-string. If the v-string has less than three components, it must have a
+leading 'v' character.  Otherwise, the leading 'v' is optional.  Both
+decimal and dotted-decimal versions may have a trailing "alpha"
+component separated by an underscore character after a fractional or
+dotted-decimal component.  The parenthesized text indicates which
+criteria were not met.  See the L<version> module for more details on
+allowed version formats.
 
-=item Invalid version format (underscores before decimal)
+=item Invalid version object
 
-(F) Versions may not contain decimals after the optional underscore.
-See L<version> for the allowed version formats.
+(F)  The internal structure of the version object was invalid.  Perhaps
+the internals were modified directly in some way or an arbitrary reference
+was blessed into the "version" class.
 
 =item ioctl is not implemented
 
@@ -3461,6 +3478,11 @@ to even) byte length.
 
 (P) The lexer got into a bad state while processing a case modifier.
 
+=item Parsing code internal error (%s)
+
+(F) Parsing code supplied by an extension violated the parser's API in
+a detectable way.
+
 =item Pattern subroutine nesting without pos change exceeded limit in regex; marked by <-- HERE in m/%s/
 
 (F) You used a pattern that uses too many nested subpattern calls without
@@ -4011,7 +4033,12 @@ where the problem was discovered. See L<perlre>.
 
 (F) You used a regular expression extension that doesn't make sense.  The
 <-- HERE shows in the regular expression about where the problem was
-discovered.  See L<perlre>.
+discovered.  This happens when using the C<(?^...)> construct to tell
+Perl to use the default regular expression modifiers, and you
+redundantly specify a default modifier; or having a modifier that can't
+be turned off (such as C<"p"> or C<"l">) after a minus; or specifying
+more than one of the C<"d">, C<"l">, or C<"u"> modifiers.  For other
+causes, see L<perlre>.
 
 =item Sequence \%s... not terminated in regex; marked by <-- HERE in m/%s/
 
@@ -5033,6 +5060,17 @@ name. So no namespace is current at all. Using this can cause many
 otherwise reasonable constructs to fail in baffling ways. C<use strict;>
 instead.
 
+=item Use of qw(...) as parentheses is deprecated
+
+(D deprecated) You have something like C<foreach $x qw(a b c) {...}>,
+using a C<qw(...)> list literal where a parenthesised expression is
+expected.  Historically the parser fooled itself into thinking that
+C<qw(...)> literals were always enclosed in parentheses, and as a result
+you could sometimes omit parentheses around them.  (You could never do
+the C<foreach qw(a b c) {...}> that you might have expected, though.)
+The parser no longer lies to itself in this way.  Wrap the list literal
+in parentheses, like C<foreach $x (qw(a b c)) {...}>.
+
 =item Use of reference "%s" as array index
 
 (W misc) You tried to use a reference as an array index; this probably