[EMAIL PROTECTED] wrote:
On Tue, 2005-07-12 at 10:46 +1000, [EMAIL PROTECTED] wrote:
1. Add code to handle the 'both false' case, similiar to
my $class = ref $proto || $proto;
warn 'wrong calling convention for Class::Constructor::new - try
Class::Constructor->new' and return unless $class;
Why not delete the code entirely? Do these classes *really* expect
users to call them with anything besides Classname->new()?
I'd put it this way.
1. Classes that dont test for a valid package name in their constructor
do not expect to be called in any way other than Classname->new().
2. Those classes fail badly when a naive/inexperienced/drunk/whatever
user uses the wrong convention
3. Classes that test for a valid package name dont suffer from 2.
4. That said, 2 doesnt happen very often. Whether the developer wants to
protection when it does happen is up to the developer. Getting 100%
coverage via D::C is another motivation.
--
Leif Eriksen
Snr Developer
http://www.hpa.com.au/
phone: +61 3 9217 5545
email: [EMAIL PROTECTED]