This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perlfunc/gethostbyname: Add missing C in C<>
[perl5.git] / pod / perldiag.pod
index 4aa76e2..45322c2 100644 (file)
@@ -1478,7 +1478,7 @@ L<overload/Copy Constructor>.
 =item &CORE::%s cannot be called directly
 
 (F) You tried to call a subroutine in the C<CORE::> namespace
-with C<&foo> syntax or through a reference.  The subroutines
+with C<&foo> syntax or through a reference.  Most subroutines
 in this package cannot yet be called that way, but must be
 called as barewords.  Something like this will work:
 
@@ -1527,21 +1527,26 @@ array is empty, just use C<if (@array) { # not empty }> for example.
 
 =item defined(%hash) is deprecated
 
-(D deprecated) C<defined()> is not usually useful on hashes, because it
-is not a reliable check for anything.  Sometimes it returns true on
-an empty hash, and sometimes false.  If a non-empty check is what you
-want then just use:
+(D deprecated) C<defined()> is not usually right on hashes and has been
+discouraged since 5.004.
+
+Although C<defined %hash> is false on a plain not-yet-used hash, it
+becomes true in several non-obvious circumstances, including iterators,
+weak references, stash names, even remaining true after C<undef %hash>.
+These things make C<defined %hash> fairly useless in practice.
+
+If a check for non-empty is what you wanted then just put it in boolean
+context (see L<perldata/Scalar values>):
 
     if (%hash) {
        # not empty
     }
 
-If you had C<defined(%Foo::Bar::QUUX)> to check whether such a
-package variable exists, then it has never actually done that,
-but instead creates the hash if necessary (autovivification)
-then tests for non-empty.  If you really want to check
-existence of a package variable then look at the glob slot
-with C<defined *Foo::Bar::QUUX{HASH}> (see L<perlref>).
+If you had C<defined %Foo::Bar::QUUX> to check whether such a package
+variable exists then that's never really been reliable, and isn't
+a good way to enquire about the features of a package, or whether
+it's loaded, etc.
+
 
 =item (?(DEFINE)....) does not allow branches in regex; marked by <-- HERE in m/%s/
 
@@ -4446,8 +4451,7 @@ before this, because Perl is good at understanding random input.
 Occasionally the line number may be misleading, and once in a blue moon
 the only way to figure out what's triggering the error is to call
 C<perl -c> repeatedly, chopping away half the program each time to see
-if the error went away.  Sort of the cybernetic version of S<20
-questions>.
+if the error went away.  Sort of the cybernetic version of S<20 questions>.
 
 =item syntax error at line %d: `%s' unexpected
 
@@ -4658,6 +4662,13 @@ disallowed. See L<Safe>.
 (F) Your machine doesn't implement a file truncation mechanism that
 Configure knows about.
 
+=item Type of arg %d to &CORE::%s must be %s
+
+(F) The subroutine in question in the CORE package requires its argument
+to be a hard reference to data of the specified type.  Overloading is
+ignored, so a reference to an object that is not the specified type, but
+nonetheless has overloading to handle it, will still not be accepted.
+
 =item Type of arg %d to %s must be %s (not %s)
 
 (F) This function requires the argument in that position to be of a
@@ -5326,15 +5337,6 @@ currently reserved for future use, as the exact behaviour has not
 been decided. (Simply returning the boolean opposite of the
 modified string is usually not particularly useful.)
 
-=item User-defined case-mapping '%s' is deprecated
-
-(W deprecated) You defined a function, such as C<ToLower> that overrides
-the standard case mapping, such as C<lc()> gives.  This feature is being
-deprecated due to its many issues, as documented in
-L<perlunicode/User-Defined Case Mappings (for serious hackers only)>.
-It is planned to remove this feature in Perl 5.16.  A CPAN module
-providing improved functionality is being prepared.
-
 =item UTF-16 surrogate U+%X
 
 (W utf8, surrogate) You had a UTF-16 surrogate in a context where they are