Skip Menu |

This queue is for tickets about the Class-BuildMethods CPAN distribution.

Report information
The Basics
Id: 23289
Status: resolved
Priority: 0/
Queue: Class-BuildMethods

People
Owner: Nobody in particular
Requestors: collinw [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.12
Fixed in: (no value)



Subject: C::BM does not accept false defaults
As of 0.12, Class::BuildMethods does not allow default values to be false. Attempting to use 0 or "" as a default value results in a default value of undef. This is caused by simple truth tests on $default_for{$method}, rather an exists-based tests. This can be fixed by using exists on lines 164 and 192 of lib/Class/BuildMethods.pm Thanks, Collin Winter
From: OVID [...] cpan.org
On Tue Nov 14 21:33:30 2006, collinw wrote: Show quoted text
> As of 0.12, Class::BuildMethods does not allow default values to be > false. Attempting to use 0 or "" as a default value results in a default > value of undef. This is caused by simple truth tests on > $default_for{$method}, rather an exists-based tests. > > This can be fixed by using exists on lines 164 and 192 of > lib/Class/BuildMethods.pm
Hi Collin, Thanks for the bug report. I have fixed this bug and uploaded it as Class::BuildMethods 0.20. Hopefully it should be available soon. Also, this version now adds class data support: package Universe; use Class::BuildMethods pi => { class_data => 1, default => 3.1415927, }; Cheers, Ovidd
Fixed in 0.20.