X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/714f94d1f69f6267a390f59f2cf64240cf49a484..b2a6778b4b1c3d84180bbc518a6f3d36545d50bc:/pod/perldiag.pod diff --git a/pod/perldiag.pod b/pod/perldiag.pod index c05d00a..b069fb1 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -656,6 +656,13 @@ the warning. See L. (F) You passed an invalid number (like an infinity or not-a-number) to C. +=item Cannot complete in-place edit of %s: %s + +(F) Your perl script appears to have changed directory while +performing an in-place edit of a file specified by a relative path, +and your system doesn't include the directory relative POSIX functions +needed to handle that. + =item Cannot compress %f in pack (F) You tried compressing an infinity or not-a-number as an unsigned @@ -1311,9 +1318,14 @@ the modified file. The file was left unmodified. =item Can't rename %s to %s: %s, skipping file -(S inplace) The rename done by the B<-i> switch failed for some reason, +(F) The rename done by the B<-i> switch failed for some reason, probably because you don't have write permission to the directory. +=item Can't rename in-place work file '%s' to '%s': %s + +(F) When closed implicitly, the temporary file for in-place editing +couldn't be renamed to the original filename. + =item Can't reopen input pipe (name: %s) in binary mode (P) An error peculiar to VMS. Perl thought stdin was a pipe, and tried @@ -1524,6 +1536,11 @@ expression pattern. Trying to do this in ordinary Perl code produces a value that prints out looking like SCALAR(0xdecaf). Use the $1 form instead. +=item Can't unweaken a nonreference + +(F) You attempted to unweaken something that was not a reference. Only +references can be unweakened. + =item Can't weaken a nonreference (F) You attempted to weaken something that was not a reference. Only @@ -2306,7 +2323,7 @@ Check the #! line, or manually feed your script into Perl yourself. CHECK, INIT, or END subroutine. Processing of the remainder of the queue of such routines has been prematurely ended. -=item Failed to close in-place edit file %s: %s +=item Failed to close in-place work file %s: %s (F) Closing an output file from in-place editing, as with the C<-i> command-line switch, failed. @@ -2635,6 +2652,17 @@ this error when Perl was built using standard options. For some reason, your version of Perl appears to have been built without this support. Talk to your Perl administrator. +=item Illegal operator following parameter in a subroutine signature + +(F) A parameter in a subroutine signature, was followed by something +other than C<=> introducing a default, C<,> or C<)>. + + use feature 'signatures'; + sub foo ($=1) {} # legal + sub foo ($a = 1) {} # legal + sub foo ($a += 1) {} # illegal + sub foo ($a == 1) {} # illegal + =item Illegal character following sigil in a subroutine signature (F) A parameter in a subroutine signature contained an unexpected character @@ -2799,12 +2827,12 @@ for instance C, which resulted in re-executing the same pattern, which is an infinite loop which is broken by throwing an exception. -=item Initialization of state variables in list context currently forbidden +=item Initialization of state variables in list currently forbidden -(F) C only permits initializing a single scalar variable, in scalar -context. So C is allowed, but not C. To apply -state semantics to a hash or array, store a hash or array reference in a -scalar variable. +(F) C only permits initializing a single variable, specified +without parentheses. So C and C are +allowed, but not C or C<(state $a) = 42>. To initialize +more than one C variable, initialize them one at a time. =item %%s[%s] in scalar context better written as $%s[%s] @@ -5204,6 +5232,11 @@ to use parens. In any case, a hash requires key/value B. (W misc) You have attempted to weaken a reference that is already weak. Doing so has no effect. +=item Reference is not weak + +(W misc) You have attempted to unweaken a reference that is not weak. +Doing so has no effect. + =item Reference to invalid group 0 in regex; marked by S<<-- HERE> in m/%s/ (F) You used C<\g0> or similar in a regular expression. You may refer @@ -7052,12 +7085,6 @@ C<$array[0+$ref]>. This warning is not given for overloaded objects, however, because you can overload the numification and stringification operators and then you presumably know what you are doing. -=item Use of state $_ is experimental - -(S experimental::lexical_topic) Lexical $_ is an experimental feature and -its behavior may change or even be removed in any future release of perl. -See the explanation under L. - =item Use of strings with code points over 0xFF as arguments to %s operator is not allowed @@ -7249,14 +7276,42 @@ known at compile time. For positive lookbehind, you can use the C<\K> regex construct as a way to get the equivalent functionality. See L<(?<=pattern) and \K in perlre|perlre/\K>. -There are non-obvious Unicode rules under C that can match variably, -but which you might not think could. For example, the substring C<"ss"> -can match the single character LATIN SMALL LETTER SHARP S. There are -other sequences of ASCII characters that can match single ligature -characters, such as LATIN SMALL LIGATURE FFI matching C. -Starting in Perl v5.16, if you only care about ASCII matches, adding the -C modifier to the regex will exclude all these non-obvious matches, -thus getting rid of this message. You can also say C> +Starting in Perl 5.18, there are non-obvious Unicode rules under C +that can match variably, but which you might not think could. For +example, the substring C<"ss"> can match the single character LATIN +SMALL LETTER SHARP S. Here's a complete list of the current ones +affecting ASCII characters: + + ASCII + sequence Matches single letter under /i + FF U+FB00 LATIN SMALL LIGATURE FF + FFI U+FB03 LATIN SMALL LIGATURE FFI + FFL U+FB04 LATIN SMALL LIGATURE FFL + FI U+FB01 LATIN SMALL LIGATURE FI + FL U+FB02 LATIN SMALL LIGATURE FL + SS U+00DF LATIN SMALL LETTER SHARP S + U+1E9E LATIN CAPITAL LETTER SHARP S + ST U+FB06 LATIN SMALL LIGATURE ST + U+FB05 LATIN SMALL LIGATURE LONG S T + +This list is subject to change, but is quite unlikely to. +Each ASCII sequence can be any combination of upper- and lowercase. + +You can avoid this by using a bracketed character class in the +lookbehind assertion, like + + (? modifier to the regex. This will +exclude all these non-obvious matches, thus getting rid of this message. +You can also say + + use if $] ge 5.016, re => '/aa'; + to apply C to all regular expressions compiled within its scope. See L.