This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Use "UTF-8" consistently in perldelta
[perl5.git] / pod / perldiag.pod
index e6b0562..93ae13b 100644 (file)
@@ -560,7 +560,7 @@ copiable.
 encountered an invalid data type.
 
 =item Both or neither range ends should be Unicode in regex; marked by
 encountered an invalid data type.
 
 =item Both or neither range ends should be Unicode in regex; marked by
-<-- HERE in m/%s/
+S<<-- HERE> in m/%s/
 
 (W regexp) (only under C<S<use re 'strict'>> or within C<(?[...])>)
 
 
 (W regexp) (only under C<S<use re 'strict'>> or within C<(?[...])>)
 
@@ -1559,7 +1559,7 @@ defined in the C<:alias> import argument to C<use charnames>, but they
 could be defined by a translator installed into C<$^H{charnames}>.
 See L<charnames/CUSTOM ALIASES>.
 
 could be defined by a translator installed into C<$^H{charnames}>.
 See L<charnames/CUSTOM ALIASES>.
 
-=item \C is deprecated in regex; marked by <-- HERE in m/%s/
+=item \C is deprecated in regex; marked by S<<-- HERE> in m/%s/
 
 (D deprecated, regexp) The \C character class is deprecated, and will
 become a compile-time error in a future release of perl (tentatively
 
 (D deprecated, regexp) The \C character class is deprecated, and will
 become a compile-time error in a future release of perl (tentatively
@@ -1718,7 +1718,7 @@ workarounds.
 (F) The parser found inconsistencies either while attempting
 to define an overloaded constant, or when trying to find the
 character name specified in the C<\N{...}> escape.  Perhaps you
 (F) The parser found inconsistencies either while attempting
 to define an overloaded constant, or when trying to find the
 character name specified in the C<\N{...}> escape.  Perhaps you
-forgot to load the corresponding L<overload> pragma?.
+forgot to load the corresponding L<overload> pragma?
 
 =item :const is experimental
 
 
 =item :const is experimental
 
@@ -1801,7 +1801,7 @@ S<<-- HERE> in m/%s/
 most likely cause of this error is that you left out a parenthesis inside
 of the C<....> part.
 
 most likely cause of this error is that you left out a parenthesis inside
 of the C<....> part.
 
-The <-- HERE shows whereabouts in the regular expression the problem was
+The S<<-- HERE> shows whereabouts in the regular expression the problem was
 discovered.
 
 =item %s defines neither package nor VERSION--version check failed
 discovered.
 
 =item %s defines neither package nor VERSION--version check failed
@@ -2024,7 +2024,7 @@ S<<-- HERE> in m/%s/
 (F) You used a pattern that nested too many EVAL calls without consuming
 any text.  Restructure the pattern so that text is consumed.
 
 (F) You used a pattern that nested too many EVAL calls without consuming
 any text.  Restructure the pattern so that text is consumed.
 
-The <-- HERE shows whereabouts in the regular expression the problem was
+The S<<-- HERE> shows whereabouts in the regular expression the problem was
 discovered.
 
 =item Excessively long <> operator
 discovered.
 
 =item Excessively long <> operator
@@ -2802,6 +2802,13 @@ character (U+FFFD).
 with the B<-D> option with no flags to see the list of acceptable values.
 See also L<perlrun/-Dletters>.
 
 with the B<-D> option with no flags to see the list of acceptable values.
 See also L<perlrun/-Dletters>.
 
+=item Invalid quantifier in {,} in regex; marked by S<<-- HERE> in m/%s/
+
+(F) The pattern looks like a {min,max} quantifier, but the min or max
+could not be parsed as a valid number - either it has leading zeroes,
+or it represents too big a number to cope with.  The S<<-- HERE> shows
+where in the regular expression the problem was discovered.  See L<perlre>.
+
 =item Invalid [] range "%s" in regex; marked by S<<-- HERE> in m/%s/
 
 (F) The range specified in a character class had a minimum character
 =item Invalid [] range "%s" in regex; marked by S<<-- HERE> in m/%s/
 
 (F) The range specified in a character class had a minimum character
@@ -2894,7 +2901,13 @@ with 'useperlio'.
 (F) Your machine doesn't implement the sockatmark() functionality,
 neither as a system call nor an ioctl call (SIOCATMARK).
 
 (F) Your machine doesn't implement the sockatmark() functionality,
 neither as a system call nor an ioctl call (SIOCATMARK).
 
-=item "%s" is more clearly written simply as "%s" in regex; marked by <-- HERE in m/%s/
+=item '%s' is an unknown bound type in regex; marked by S<<-- HERE> in m/%s/
+
+(F) You used C<\b{...}> or C<\B{...}> and the C<...> is not known to
+Perl.  The current valid ones are given in
+L<perlrebackslash/\b{}, \b, \B{}, \B>.
+
+=item "%s" is more clearly written simply as "%s" in regex; marked by S<<-- HERE> in m/%s/
 
 (W regexp) (only under C<S<use re 'strict'>> or within C<(?[...])>)
 
 
 (W regexp) (only under C<S<use re 'strict'>> or within C<(?[...])>)
 
@@ -3599,8 +3612,7 @@ bracketed character class, for the same reason that C<.> in a character
 class loses its specialness: it matches almost everything, which is
 probably not what you want.
 
 class loses its specialness: it matches almost everything, which is
 probably not what you want.
 
-=item \N{} in inverted character class or as a range end-point is restricted to one character in regex; marked
-by S<<-- HERE> in m/%s/
+=item \N{} in inverted character class or as a range end-point is restricted to one character in regex; marked by <-- HERE in m/%s/
 
 (F) Named Unicode character escapes (C<\N{...}>) may return a
 multi-character sequence.  Even though a character class is
 
 (F) Named Unicode character escapes (C<\N{...}>) may return a
 multi-character sequence.  Even though a character class is
@@ -3800,7 +3812,7 @@ find the name of the file to which to write data destined for stdout.
 
 (F) Fully qualified variable names are not allowed in "our"
 declarations, because that doesn't make much sense under existing
 
 (F) Fully qualified variable names are not allowed in "our"
 declarations, because that doesn't make much sense under existing
-semantics.  Such syntax is reserved for future extensions.
+rules.  Such syntax is reserved for future extensions.
 
 =item No Perl script found in input
 
 
 =item No Perl script found in input
 
@@ -4055,7 +4067,7 @@ the C<fallback> overloading key is specified to be true.  See L<overload>.
 
 =item Operation "%s" returns its argument for non-Unicode code point 0x%X
 
 
 =item Operation "%s" returns its argument for non-Unicode code point 0x%X
 
-(S non_unicode) You performed an operation requiring Unicode semantics
+(S non_unicode) You performed an operation requiring Unicode rules
 on a code point that is not in Unicode, so what it should do is not
 defined.  Perl has chosen to have it do nothing, and warn you.
 
 on a code point that is not in Unicode, so what it should do is not
 defined.  Perl has chosen to have it do nothing, and warn you.
 
@@ -4068,9 +4080,9 @@ C<no warnings 'non_unicode';>.
 =item Operation "%s" returns its argument for UTF-16 surrogate U+%X
 
 (S surrogate) You performed an operation requiring Unicode
 =item Operation "%s" returns its argument for UTF-16 surrogate U+%X
 
 (S surrogate) You performed an operation requiring Unicode
-semantics on a Unicode surrogate.  Unicode frowns upon the use
+rules on a Unicode surrogate.  Unicode frowns upon the use
 of surrogates for anything but storing strings in UTF-16, but
 of surrogates for anything but storing strings in UTF-16, but
-semantics are (reluctantly) defined for the surrogates, and
+rules are (reluctantly) defined for the surrogates, and
 they are to do nothing for this operation.  Because the use of
 surrogates can be dangerous, Perl warns.
 
 they are to do nothing for this operation.  Because the use of
 surrogates can be dangerous, Perl warns.
 
@@ -4587,7 +4599,7 @@ take the risk of using this feature, simply disable this warning:
 
     no warnings "experimental::autoderef";
 
 
     no warnings "experimental::autoderef";
 
-=item POSIX class [:%s:] unknown in regex; marked by S<< <-- HERE in m/%s/ >>
+=item POSIX class [:%s:] unknown in regex; marked by S<<-- HERE> in m/%s/
 
 (F) The class in the character class [: :] syntax is unknown.  The S<<-- HERE>
 shows whereabouts in the regular expression the problem was discovered.
 
 (F) The class in the character class [: :] syntax is unknown.  The S<<-- HERE>
 shows whereabouts in the regular expression the problem was discovered.
@@ -4829,14 +4841,13 @@ take the risk of using this feature, simply disable this warning:
 
     no warnings "experimental::autoderef";
 
 
     no warnings "experimental::autoderef";
 
-=item Quantifier follows nothing in regex; marked by S<< <-- HERE in m/%s/ >>
+=item Quantifier follows nothing in regex; marked by S<<-- HERE> in m/%s/
 
 (F) You started a regular expression with a quantifier.  Backslash it if
 you meant it literally.  The S<<-- HERE> shows whereabouts in the regular
 expression the problem was discovered.  See L<perlre>.
 
 
 (F) You started a regular expression with a quantifier.  Backslash it if
 you meant it literally.  The S<<-- HERE> shows whereabouts in the regular
 expression the problem was discovered.  See L<perlre>.
 
-=item Quantifier in {,} bigger than %d in regex; marked by S<<-- HERE> in
-m/%s/
+=item Quantifier in {,} bigger than %d in regex; marked by S<<-- HERE> in m/%s/
 
 (F) There is currently a limit to the size of the min and max values of
 the {min,max} construct.  The S<<-- HERE> shows whereabouts in the regular
 
 (F) There is currently a limit to the size of the min and max values of
 the {min,max} construct.  The S<<-- HERE> shows whereabouts in the regular
@@ -4866,7 +4877,7 @@ One possible workaround is to force Perl to use magical string increment
 by prepending "0" to your numbers.
 
 =item Ranges of ASCII printables should be some subset of "0-9", "A-Z", or
 by prepending "0" to your numbers.
 
 =item Ranges of ASCII printables should be some subset of "0-9", "A-Z", or
-"a-z" in regex; marked by <-- HERE in m/%s/
+"a-z" in regex; marked by S<<-- HERE> in m/%s/
 
 (W regexp) (only under C<S<use re 'strict'>> or within C<(?[...])>)
 
 
 (W regexp) (only under C<S<use re 'strict'>> or within C<(?[...])>)
 
@@ -4895,7 +4906,7 @@ character, and not some escape sequence (like C<"\x41">), and the ranges
 must be all digits, or all uppercase letters, or all lowercase letters.
 
 =item Ranges of digits should be from the same group in regex; marked by
 must be all digits, or all uppercase letters, or all lowercase letters.
 
 =item Ranges of digits should be from the same group in regex; marked by
-<-- HERE in m/%s/
+S<<-- HERE> in m/%s/
 
 (W regexp) (only under C<S<use re 'strict'>> or within C<(?[...])>)
 
 
 (W regexp) (only under C<S<use re 'strict'>> or within C<(?[...])>)
 
@@ -4998,7 +5009,7 @@ not at least seven sets of capturing parentheses in the expression.  If
 you wanted to have the character with ordinal 7 inserted into the regular
 expression, prepend zeroes to make it three digits long: C<\007>
 
 you wanted to have the character with ordinal 7 inserted into the regular
 expression, prepend zeroes to make it three digits long: C<\007>
 
-The <-- HERE shows whereabouts in the regular expression the problem was
+The S<<-- HERE> shows whereabouts in the regular expression the problem was
 discovered.
 
 =item Reference to nonexistent named group in regex; marked by S<<-- HERE>
 discovered.
 
 =item Reference to nonexistent named group in regex; marked by S<<-- HERE>
@@ -5009,7 +5020,7 @@ expression, but there is no corresponding named capturing parentheses
 such as C<(?'NAME'...)> or C<< (?<NAME>...) >>.  Check if the name has been
 spelled correctly both in the backreference and the declaration.
 
 such as C<(?'NAME'...)> or C<< (?<NAME>...) >>.  Check if the name has been
 spelled correctly both in the backreference and the declaration.
 
-The <-- HERE shows whereabouts in the regular expression the problem was
+The S<<-- HERE> shows whereabouts in the regular expression the problem was
 discovered.
 
 =item Reference to nonexistent or unclosed group in regex; marked by
 discovered.
 
 =item Reference to nonexistent or unclosed group in regex; marked by
@@ -5019,7 +5030,7 @@ S<<-- HERE> in m/%s/
 are not at least seven sets of closed capturing parentheses in the
 expression before where the C<\g{-7}> was located.
 
 are not at least seven sets of closed capturing parentheses in the
 expression before where the C<\g{-7}> was located.
 
-The <-- HERE shows whereabouts in the regular expression the problem was
+The S<<-- HERE> shows whereabouts in the regular expression the problem was
 discovered.
 
 =item regexp memory corruption
 discovered.
 
 =item regexp memory corruption
@@ -5638,7 +5649,7 @@ is not known.  The condition must be one of the following:
  (R&NAME)           true if directly inside named capture
  (DEFINE)           always false; for defining named subpatterns
 
  (R&NAME)           true if directly inside named capture
  (DEFINE)           always false; for defining named subpatterns
 
-The <-- HERE shows whereabouts in the regular expression the problem was
+The S<<-- HERE> shows whereabouts in the regular expression the problem was
 discovered.  See L<perlre>.
 
 =item Switch (?(condition)... not terminated in regex; marked by
 discovered.  See L<perlre>.
 
 =item Switch (?(condition)... not terminated in regex; marked by
@@ -5750,6 +5761,18 @@ as a compiler directive.  You may say only one of
 This is to prevent the problem of one module changing the array base out
 from under another module inadvertently.  See L<perlvar/$[> and L<arybase>.
 
 This is to prevent the problem of one module changing the array base out
 from under another module inadvertently.  See L<perlvar/$[> and L<arybase>.
 
+=item The bitwise feature is experimental
+
+(S experimental::bitwise) This warning is emitted if you use bitwise
+operators (C<& | ^ ~ &. |. ^. ~.>) with the "bitwise" feature enabled.
+Simply suppress the warning if you want to use the feature, but know
+that in doing so you are taking the risk of using an experimental
+feature which may change or be removed in a future Perl version:
+
+    no warnings "experimental::bitwise";
+    use feature "bitwise";
+    $x |.= $y;
+
 =item The crypt() function is unimplemented due to excessive paranoia.
 
 (F) Configure couldn't find the crypt() function on your machine,
 =item The crypt() function is unimplemented due to excessive paranoia.
 
 (F) Configure couldn't find the crypt() function on your machine,
@@ -6039,7 +6062,7 @@ C<undef *foo>.
 Check the #! line, or manually feed your script into Perl yourself.
 
 =item Unescaped left brace in regex is deprecated, passed through in regex;
 Check the #! line, or manually feed your script into Perl yourself.
 
 =item Unescaped left brace in regex is deprecated, passed through in regex;
-marked by <-- HERE in m/%s/
+marked by S<<-- HERE> in m/%s/
 
 (D deprecated, regexp) You used a literal C<"{"> character in a regular
 expression pattern.  You should change to use C<"\{"> instead, because a
 
 (D deprecated, regexp) You used a literal C<"{"> character in a regular
 expression pattern.  You should change to use C<"\{"> instead, because a
@@ -6212,7 +6235,7 @@ is not known.  The condition must be one of the following:
  (R&NAME)           true if directly inside named capture
  (DEFINE)           always false; for defining named subpatterns
 
  (R&NAME)           true if directly inside named capture
  (DEFINE)           always false; for defining named subpatterns
 
-The <-- HERE shows whereabouts in the regular expression the problem was
+The S<<-- HERE> shows whereabouts in the regular expression the problem was
 discovered.  See L<perlre>.
 
 =item Unknown Unicode option letter '%c'
 discovered.  See L<perlre>.
 
 =item Unknown Unicode option letter '%c'
@@ -6491,7 +6514,7 @@ must be written as
 
     if ($string =~ /$pattern/) { ... }
 
 
     if ($string =~ /$pattern/) { ... }
 
-The <-- HERE shows whereabouts in the regular expression the problem was
+The S<<-- HERE> shows whereabouts in the regular expression the problem was
 discovered.  See L<perlre>.
 
 =item Useless localization of %s
 discovered.  See L<perlre>.
 
 =item Useless localization of %s
@@ -6512,7 +6535,7 @@ must be written as
 
     if ($string =~ /$pattern/o) { ... }
 
 
     if ($string =~ /$pattern/o) { ... }
 
-The <-- HERE shows whereabouts in the regular expression the problem was
+The S<<-- HERE> shows whereabouts in the regular expression the problem was
 discovered.  See L<perlre>.
 
 =item Useless use of attribute "const"
 discovered.  See L<perlre>.
 
 =item Useless use of attribute "const"
@@ -6626,6 +6649,15 @@ is deprecated.  See L<perlvar/"$[">.
 form if you wish to use an empty line as the terminator of the
 here-document.
 
 form if you wish to use an empty line as the terminator of the
 here-document.
 
+=item Use of \b{} for non-UTF-8 locale is wrong.  Assuming a UTF-8 locale
+
+(W locale)  You are matching a regular expression using locale rules,
+and a Unicode boundary is being matched, but the locale is not a Unicode
+one.  This doesn't make sense.  Perl will continue, assuming a Unicode
+(UTF-8) locale, but the results could well be wrong except if the locale
+happens to be ISO-8859-1 (Latin1) where this message is spurious and can
+be ignored.
+
 =item Use of chdir('') or chdir(undef) as chdir() deprecated
 
 (D deprecated) chdir() with no arguments is documented to change to
 =item Use of chdir('') or chdir(undef) as chdir() deprecated
 
 (D deprecated) chdir() with no arguments is documented to change to
@@ -6847,6 +6879,15 @@ a range.  For these, what should happen isn't clear at all.  In
 these circumstances, Perl discards all but the first character
 of the returned sequence, which is not likely what you want.
 
 these circumstances, Perl discards all but the first character
 of the returned sequence, which is not likely what you want.
 
+=item Using /u for '%s' instead of /%s in regex; marked by S<<-- HERE> in m/%s/
+
+(W regexp) You used a Unicode boundary (C<\b{...}> or C<\B{...}>) in a
+portion of a regular expression where the character set modifiers C</a>
+or C</aa> are in effect.  These two modifiers indicate an ASCII
+interpretation, and this doesn't make sense for a Unicode defintion.
+The generated regular expression will compile so that the boundary uses
+all of Unicode.  No other portion of the regular expression is affected.
+
 =item Using !~ with %s doesn't make sense
 
 (F) Using the C<!~> operator with C<s///r>, C<tr///r> or C<y///r> is
 =item Using !~ with %s doesn't make sense
 
 (F) Using the C<!~> operator with C<s///r>, C<tr///r> or C<y///r> is
@@ -7064,7 +7105,7 @@ filehandle with an encoding, see L<open> and L<perlfunc/binmode>.
 
 (W locale) While in a single-byte locale (I<i.e.>, a non-UTF-8
 one), a multi-byte character was encountered.   Perl considers this
 
 (W locale) While in a single-byte locale (I<i.e.>, a non-UTF-8
 one), a multi-byte character was encountered.   Perl considers this
-character to be the specified Unicode code point.  Combining non-UTF8
+character to be the specified Unicode code point.  Combining non-UTF-8
 locales and Unicode is dangerous.  Almost certainly some characters
 will have two different representations.  For example, in the ISO 8859-7
 (Greek) locale, the code point 0xC3 represents a Capital Gamma.  But so
 locales and Unicode is dangerous.  Almost certainly some characters
 will have two different representations.  For example, in the ISO 8859-7
 (Greek) locale, the code point 0xC3 represents a Capital Gamma.  But so