Skip Menu |

This queue is for tickets about the Scalar-List-Utils CPAN distribution.

Report information
The Basics
Id: 88201
Status: resolved
Priority: 0/
Queue: Scalar-List-Utils

People
Owner: Nobody in particular
Requestors: MYSZ [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 1.32



Subject: Scalar::Util::blessed() returns "false" on package named '0'
If you create class named '0', blessed() returns this value on it's instance. Blessed usually (in known to me examples) is used in boolean comparisons, so if know you do: my $zero_instance = bless({}, '0'); if (blessed($zero_instance)) { // do not execute this} } I think it's worth to notice this in documentation. Nothing to repair here (even if this is possible), is just stupid extreme case :)
On Wed Aug 28 06:01:00 2013, MYSZ wrote: Show quoted text
> If you create class named '0', blessed() returns this value on it's > instance. Blessed usually (in known to me examples) is used in boolean > comparisons, so if know you do: > > my $zero_instance = bless({}, '0'); > if (blessed($zero_instance)) { > // do not execute this} > } > > I think it's worth to notice this in documentation. Nothing to repair > here (even if this is possible), is just stupid extreme case :)
I'll add a note to the docs. -- Paul Evans
Released in 1.32 -- Paul Evans