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'
Download (untitled) / with headers
text/plain 403b
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 :)
Download (untitled) / with headers
text/plain 513b
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


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.