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

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

Thread Previous | Thread Next
From:
Graham Barr
Date:
October 6, 2003 09:10
Subject:
Re: [PATCH pod/perlfunc.pod] ref can return false on references
Message ID:
9AD0A606-F817-11D7-B726-0003938857CC@pobox.com

On 6 Oct 2003, at 17:06, Nick Ing-Simmons wrote:

> 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
>
> I would be tempted to make that bless illegal.

I dont see why we should treat that specially. People can always bless 
into a package which has overload and have that return false.

The docs should just state that in the general case a reference is 
true, but there are exceptions and then go on to explain the exceptions

Graham.


Thread Previous | 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