This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re: [ID 20001130.011] expression parsing bug ?
[perl5.git] / pod / perldiag.pod
index 6f62e3c..830faab 100644 (file)
@@ -59,6 +59,17 @@ L<perlfunc/accept>.
 (F) The '!' is allowed in pack() and unpack() only after certain types.
 See L<perlfunc/pack>.
 
+=item Ambiguous -%c() resolved as a file test
+
+(W ambiguous) You used a "-" right in front a call to a subroutine
+that has the same name as a Perl file test (C<r w x o R W X O e z s
+f d l p S u g k b c t T B M A C>).
+
+To disambiguate it as a subroutine call, use either an extra space after
+the "-", C<- f(...)>, or an extra set of parentheses, C<-(f(...))>.
+To disambiguate it as a file test, use an extra space after the operator
+name C<-f (...)>, or add the space and remove the parentheses, C<-f ...>.
+
 =item Ambiguous call resolved as CORE::%s(), qualify as such or use &
 
 (W ambiguous) A subroutine you have declared has the same name as a Perl
@@ -182,6 +193,11 @@ spots.  This is now heavily deprecated.
 must either both be scalars or both be lists.  Otherwise Perl won't
 know which context to supply to the right side.
 
+=item Negative offset to vec in lvalue context
+
+(F) When vec is called in an lvalue context, the second argument must be
+greater than or equal to zero.
+
 =item Attempt to bless into a reference
 
 (F) The CLASSNAME argument to the bless() operator is expected to be
@@ -646,6 +662,13 @@ If you're getting this error from a here-document, you may have included
 unseen whitespace before or after your closing tag. A good programmer's
 editor will have a way to help you find these characters.
 
+=item Can't find %s property definition %s 
+
+(F) You may have tried to use C<\p> which means a Unicode property for
+example \p{Lu} is all uppercase letters.  Escape the C<\p>, either
+C<\\p> (just the C<\p>) or by C<\Q\p> (the rest of the string, until
+possible C<\E>).
+
 =item Can't fork
 
 (F) A fatal error occurred while trying to fork while opening a
@@ -1081,7 +1104,7 @@ on I<Mastering Regular Expressions>.)
 to check the return value of your socket() call?  See
 L<perlfunc/connect>.
 
-=item constant(%s): %s
+=item Constant(%s)%s: %s
 
 (F) The parser found inconsistencies either while attempting to define
 an overloaded constant, or when trying to find the character name
@@ -1111,8 +1134,8 @@ workarounds.
 
 =item Copy method did not return a reference
 
-(F) The method which overloads "=" is buggy. See L<overload/Copy
-Constructor>.
+(F) The method which overloads "=" is buggy. See 
+L<overload/Copy Constructor>.
 
 =item CORE::%s is not a keyword
 
@@ -1655,8 +1678,8 @@ shows in the regular expression about where the problem was discovered.
 
 (W syntax) You've run afoul of the rule that says that any list operator
 followed by parentheses turns into a function, with all the list
-operators arguments found inside the parentheses.  See L<perlop/Terms
-and List Operators (Leftward)>.
+operators arguments found inside the parentheses.  See 
+L<perlop/Terms and List Operators (Leftward)>.
 
 =item Invalid %s attribute: %s
 
@@ -1708,6 +1731,16 @@ silently ignored.
 (F) Your machine apparently doesn't implement ioctl(), which is pretty
 strange for a machine that supports C.
 
+=item `%s' is not a code reference
+
+(W) The second (fourth, sixth, ...) argument of overload::constant needs
+to be a code reference. Either an anonymous subroutine, or a reference
+to a subroutine.
+
+=item `%s' is not an overloadable type
+
+(W) You tried to overload a constant type the overload package is unaware of.
+
 =item junk on end of regexp
 
 (P) The regular expression parser is confused.
@@ -1758,7 +1791,7 @@ L<perlsub/"Lvalue subroutines">.
 (F) There is currently a limit on the length of string which lookbehind can
 handle. This restriction may be eased in a future release. The << HERE shows in
 the regular expression about where the problem was discovered.
-       
+
 =item Malformed PERLLIB_PREFIX
 
 (F) An error peculiar to OS/2.  PERLLIB_PREFIX should be of the form
@@ -1774,6 +1807,10 @@ a builtin library search path, prefix2 is substituted.  The error may
 appear if components are not found, or are too long.  See
 "PERLLIB_PREFIX" in L<perlos2>.
 
+=item Malformed UTF-8 character (%s)
+
+Perl detected something that didn't comply with UTF-8 encoding rules.
+
 =item Malformed UTF-16 surrogate
 
 Perl thought it was reading UTF-16 encoded character data but while
@@ -2231,6 +2268,11 @@ L<perlport> for more on portability concerns.
 
 See also L<perlport> for writing portable code.
 
+=item Odd number of arguments for overload::constant
+
+(W) The call to overload::constant contained an odd number of arguments.
+The arguments should come in pairs.
+
 =item Odd number of elements in hash assignment
 
 (W misc) You specified an odd number of elements to initialize a hash,
@@ -2305,7 +2347,8 @@ The request was judged to be small, so the possibility to trap it
 depends on the way perl was compiled.  By default it is not trappable.
 However, if compiled for this, Perl may use the contents of C<$^M> as an
 emergency pool after die()ing with this message.  In this case the error
-is trappable I<once>.
+is trappable I<once>, and the error message will include the line and file
+where the failed request happened.
 
 =item Out of memory during ridiculously large request
 
@@ -2543,13 +2586,23 @@ C<sh>-shell in.  See "PERL_SH_DIR" in L<perlos2>.
 
 Exactly what were the failed locale settings varies.  In the above the
 settings were that the LC_ALL was "En_US" and the LANG had no value.
-This error means that Perl detected that you and/or your system
-administrator have set up the so-called variable system but Perl could
-not use those settings.  This was not dead serious, fortunately: there
-is a "default locale" called "C" that Perl can and will use, the script
-will be run.  Before you really fix the problem, however, you will get
-the same error message each time you run Perl.  How to really fix the
-problem can be found in L<perllocale> section B<LOCALE PROBLEMS>.
+This error means that Perl detected that you and/or your operating
+system supplier and/or system administrator have set up the so-called
+locale system but Perl could not use those settings.  This was not
+dead serious, fortunately: there is a "default locale" called "C" that
+Perl can and will use, the script will be run.  Before you really fix
+the problem, however, you will get the same error message each time
+you run Perl.  How to really fix the problem can be found in
+L<perllocale> section B<LOCALE PROBLEMS>.
+
+=item perlio: unknown layer "%s"
+
+(S) An attempt was made to push an unknown layer onto the Perl I/O
+system.  (Layers take care of transforming data between external and
+internal representations.)  Note that some layers, such as C<mmap>,
+are not supported in all environments.  If your program didn't
+explicitly request the failing operation, it may be the result of the
+value of the environment variable PERLIO.
 
 =item Permission denied
 
@@ -2786,7 +2839,7 @@ Doing so has no effect.
 (W internal) The internal sv_replace() function was handed a new SV with
 a reference count of other than 1.
 
-=item Reference to nonexistant group before << HERE in regex m/%s/
+=item Reference to nonexistent group before << HERE in regex m/%s/
 
 (F) You used something like C<\7> in your regular expression, but there are
 not at least seven sets of capturing parentheses in the expression. If you
@@ -2879,6 +2932,11 @@ filehandle that was either never opened or has since been closed.
 
 (F) This machine doesn't implement the select() system call.
 
+=item Self-ties of arrays and hashes are not supported
+
+(F) Self-ties are of arrays and hashes are not supported in
+the current implementation.
+
 =item Semicolon seems to be missing
 
 (W semicolon) A nearby syntax error was probably caused by a missing
@@ -3211,7 +3269,7 @@ will deny it.
 The function indicated isn't implemented on this architecture, according
 to the probings of Configure.
 
-=item The stat preceding C<-l _> wasn't an lstat
+=item The stat preceding %s wasn't an lstat
 
 (F) It makes no sense to test the current stat buffer for symbolic
 linkhood if the last stat that wrote to the stat buffer already went
@@ -3798,6 +3856,10 @@ but in actual fact, you got
 
 So put in parentheses to say what you really mean.
 
+=item Wide character in %s
+
+(F) Perl met a wide character (>255) when it wasn't expecting one.
+
 =item write() on closed filehandle %s
 
 (W closed) The filehandle you're writing to got itself closed sometime