On Tue, 2005-07-12 at 10:46 +1000, [EMAIL PROTECTED] wrote:

> I'd say this idiom is one of the ones I am most often affected by in the 
> work I do for the Kwalitee project - the my$class = ref$proto||$proto; 
> idiom in constructors. I usually do the following
> 
> 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 find it baffling that the Perl documentation recommends that
technique, but until recently it recommended calling UNIVERSAL::isa()
directly too.

-- c

Reply via email to