develooper Front page | perl.perl5.porters | Postings from October 2003

[PATCH pod/perlfunc.pod] ref can return false on references

Thread Next
From:
Abigail
Date:
October 6, 2003 05:55
Subject:
[PATCH pod/perlfunc.pod] ref can return false on references
Message ID:
20031006125521.GA26446@ucan.foad.org

The first sentence of 'perldoc -f ref' is wrong:

    Returns a true value if EXPR is a reference, false otherwise.

To wit:

    $ perl -wle 'print ref bless [] => 0'
    0

Patch follows.


Abigail

--- pod/perlfunc.pod.orig       Mon Oct  6 14:45:36 2003
+++ pod/perlfunc.pod    Mon Oct  6 14:46:46 2003
@@ -3987,7 +3987,8 @@
 
 =item ref
 
-Returns a true value if EXPR is a reference, false otherwise.  If EXPR
+Returns a non-empty string if EXPR is a reference, the empty
+string otherwise. If EXPR
 is not specified, C<$_> will be used.  The value returned depends on the
 type of thing the reference is a reference to.
 Builtin types include:


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About