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
October 6, 2003 14:17
Re: [PATCH pod/perlfunc.pod] ref can return false on references
Message ID:
On Mon, Oct 06, 2003 at 10:26:20PM +0200, Rafael Garcia-Suarez wrote:
> Abigail wrote:
> > 
> > If someone writes a patch to disallow blessing into the class '0',
> > I wouldn't oppose it (and I guess the case is edgy enough it doesn't
> > need a deprecation cycle), but until then, I think the documentation
> > should be correct. And I'd think that 5.8.2 should just have the doc
> > patch, not the bless patch to be.
> What about making C<ref bless [], 0> return "main::0" ? It's a true value
> and it's a correct package name. And with that the documentation can
> be restored to its previous state if you like.

That looks like a horrible kludge to me, and it breaks the element of the
least surprise. I'd expect the following to be true (for anything other
than ""):

    $foo eq ref bless [] => $foo

and not to have another exception.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About