This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldiag: reflow ‘Number with no digits’
[perl5.git] / pod / perldiag.pod
index 23f6e60..7516ef4 100644 (file)
@@ -119,7 +119,9 @@ the varable, you can just write C<@foo>.  If you wanted to call the
 function, write C<@{foo()}> ... or you could just not have a variable
 and a function with the same name, and save yourself a lot of trouble.
 
-=item Ambiguous use of %c{%s%s} resolved to %c%s%s
+=item Ambiguous use of %c{%s[...]} resolved to %c%s[...]
+
+=item Ambiguous use of %c{%s{...}} resolved to %c%s{...}
 
 (W ambiguous) You wrote something like C<${foo[2]}> (where foo
 represents the name of a Perl keyword), which might be looking for
@@ -2248,6 +2250,12 @@ The escape was replaced with REPLACEMENT CHARACTER (U+FFFD) instead.
 The <-- HERE shows in the regular expression about where the
 escape was discovered.
 
+=item Invalid hexadecimal number in \N{U+...}
+
+(F) The character constant represented by C<...> is not a valid hexadecimal
+number.  Either it is empty, or you tried to use a character other than
+0 - 9 or A - F, a - f in a hexadecimal number.
+
 =item Invalid mro name: '%s'
 
 (F) You tried to C<mro::set_mro("classname", "foo")> or C<use mro 'foo'>,
@@ -2748,23 +2756,37 @@ See L<perlfunc/pack>.
 (F) Lexically scoped subroutines are not yet implemented.  Don't try
 that yet.
 
-=item "%s" variable %s can't be in a package
+=item "my" variable %s can't be in a package
 
 (F) Lexically scoped variables aren't in a package, so it doesn't make
 sense to try to declare one with a package qualifier on the front.  Use
 local() if you want to localize a package variable.
 
+=item Name "%s::%s" used only once: possible typo
+
+(W once) Typographical errors often show up as unique variable names.
+If you had a good reason for having a unique name, then just mention it
+again somehow to suppress the message.  The C<our> declaration is
+provided for this purpose.
+
+NOTE: This warning detects symbols that have been used only once so $c, @c,
+%c, *c, &c, sub c{}, c(), and c (the filehandle or format) are considered
+the same; if a program uses $c only once but also uses any of the others it
+will not trigger this warning.
+
 =item \N in a character class must be a named character: \N{...}
 
 (F) The new (5.12) meaning of C<\N> as C<[^\n]> is not valid in a 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.
+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.
 
 =item \N{NAME} must be resolved by the lexer
 
-(F) When compiling a regex pattern, an unresolved named character or sequence
-was encountered.  This can happen in any of several ways that bypass the lexer,
-such as using single-quotish context, or an extra backslash in double quotish:
+(F) When compiling a regex pattern, an unresolved named character or
+sequence was encountered.  This can happen in any of several ways that
+bypass the lexer, such as using single-quotish context, or an extra
+backslash in double-quotish:
 
     $re = '\N{SPACE}'; # Wrong!
     $re = "\\N{SPACE}";        # Wrong!
@@ -2790,24 +2812,6 @@ C<\N> is separated by spaces from the C<{>, in which case, remove the spaces.
     /\N {SPACE}/x;     # Wrong!
     /\N{SPACE}/x;      # ok
 
-=item Name "%s::%s" used only once: possible typo
-
-(W once) Typographical errors often show up as unique variable names.
-If you had a good reason for having a unique name, then just mention it
-again somehow to suppress the message.  The C<our> declaration is
-provided for this purpose.
-
-NOTE: This warning detects symbols that have been used only once so $c, @c,
-%c, *c, &c, sub c{}, c(), and c (the filehandle or format) are considered
-the same; if a program uses $c only once but also uses any of the others it
-will not trigger this warning.
-
-=item Invalid hexadecimal number in \N{U+...}
-
-(F) The character constant represented by C<...> is not a valid hexadecimal
-number.  Either it is empty, or you tried to use a character other than 0 - 9
-or A - F, a - f in a hexadecimal number.
-
 =item Negative '/' count in unpack
 
 (F) The length count obtained from a length/code unpack operation was
@@ -2860,7 +2864,7 @@ One possible cause for this is that you expected to have imported a
 constant to your name space with B<use> or B<import> while no such
 importing took place, it may for example be that your operating system
 does not support that particular constant. Hopefully you did use an
-explicit import list for the constants you expect to see, please see
+explicit import list for the constants you expect to see; please see
 L<perlfunc/use> and L<perlfunc/import>. While an explicit import list
 would probably have caught this error earlier it naturally does not
 remedy the fact that your operating system still does not support that
@@ -2877,7 +2881,7 @@ doesn't know where you want to pipe the output from this command.
 =item No DB::DB routine defined
 
 (F) The currently executing code was compiled with the B<-d> switch, but
-for some reason the  current debugger (e.g. F<perl5db.pl> or a C<Devel::>
+for some reason the current debugger (e.g. F<perl5db.pl> or a C<Devel::>
 module) didn't define a routine to be called at the beginning of each
 statement.
 
@@ -2968,6 +2972,7 @@ your system.
 
 (F) The indicated command line switch needs a mandatory argument, but
 you haven't specified one.
+
 =item No such class field "%s" in variable %s of type %s
 
 (F) You tried to access a key from a hash through the indicated typed variable
@@ -2976,13 +2981,13 @@ package has restricted the set of allowed keys using the L<fields> pragma.
 
 =item No such class %s
 
-(F) You provided a class qualifier in a "my", "our" or "state" declaration, but
-this class doesn't exist at this point in your program.
+(F) You provided a class qualifier in a "my", "our" or "state"
+declaration, but this class doesn't exist at this point in your program.
 
 =item No such hook: %s
 
-(F) You specified a signal hook that was not recognized by Perl.  Currently, Perl
-accepts C<__DIE__> and C<__WARN__> as valid signal hooks
+(F) You specified a signal hook that was not recognized by Perl.
+Currently, Perl accepts C<__DIE__> and C<__WARN__> as valid signal hooks.
 
 =item No such pipe open
 
@@ -3076,14 +3081,15 @@ need to be added to UTC to get local time.
 
 =item Non-octal character '%c'.  Resolved as "%s"
 
-(W digit)  In parsing an octal numeric constant, a character was unexpectedly
-encountered that isn't octal.  The resulting value is as indicated.
+(W digit)  In parsing an octal numeric constant, a character was
+unexpectedly encountered that isn't octal.  The resulting value is as
+indicated.
 
 =item Non-string passed as bitmask
 
 (W misc) A number has been passed as a bitmask argument to select().
 Use the vec() function to construct the file descriptor bitmasks for
-select. See L<perlfunc/select>
+select. See L<perlfunc/select>.
 
 =item Null filename used
 
@@ -3123,8 +3129,9 @@ the meantime, try using scientific notation (e.g. "1e6" instead of
 
 =item Number with no digits
 
-(F) Perl was looking for a number but found nothing that looked like a number.
-This happens, for example with C<\o{}>, with no number between the braces.
+(F) Perl was looking for a number but found nothing that looked like
+a number. This happens, for example with C<\o{}>, with no number between
+the braces.
 
 =item Octal number in vector unsupported
 
@@ -4301,6 +4308,12 @@ unless there was a failure.  You probably wanted to use system()
 instead, which does return.  To suppress this warning, put the exec() in
 a block by itself.
 
+=item "state" variable %s can't be in a package
+
+(F) Lexically scoped variables aren't in a package, so it doesn't make
+sense to try to declare one with a package qualifier on the front.  Use
+local() if you want to localize a package variable.
+
 =item stat() on unopened filehandle %s
 
 (W unopened) You tried to use the stat() function on a filehandle that