Abigail <abigail@abigail.nl> writes: > 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: The reason this function is called ref() is because it is supposed to be true when the argument is a reference, so I think this rewording makes the documentation confusing. I think it would be better to explain this edge-case instead. I would even consider fixing bless instead to make the documentation true. Regards, GisleThread Previous | Thread Next