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:
schwern
Date:
October 7, 2003 13:27
Subject:
Re: [PATCH pod/perlfunc.pod] ref can return false on references
Message ID:
20031007132625.E4301@ttul.org
On Tue, Oct 07, 2003 at 03:29:59PM +0100, hv@crypt.org wrote:
> "Nick Ing-Simmons" <nick.ing-simmons@elixent.com> wrote:
> :But frankly if anyone wants to bless into "0" that is their problem.
> 
> I agree, and I'd go further: if someone wants to bless into "0" you
> should assume that they know what they are doing, and that they are
> probably doing it specifically (and for some good reason) so that
> ref($obj) will be false.

I really do not like the idea that we're all but blessing a way to circumvent
ref().  Its a totally unnecessary complication.  There's no use case.  I've 
never thought to myself "gee, it would be great if this reference didn't look 
like a reference".  

Furterhmore if, for some mad reason, I did want that there's always 

BEGIN { 
    *CORE::GLOBAL::ref = sub { 
	my $ref = CORE::ref($_[0]); 
	return $ref eq 'Sekret::Class' ? "" : $ref 
    }; 
}

We already have enough ways to do this particular trick.

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