On Friday 07 April 2006 06:43, A. Pagaltzis wrote: > I still wonder what’s bad about using > > UNIVERSAL::can( $foo, "can" ) > > as a pre-Scalar::Util-compatible replacement of > > blessed( $foo ) > > that is, purely as a boolean test where only the truthness of the > return value is of interest but the actual reference is not. This > is the only case for which I ever invoke `UNIVERSAL::can` as a > function. (`UNIVERSAL::isa` I never invoke as a function at all.)
The lack of multimethods with variant return types is what's bad about it. I trust you to get it right and me to get it right and just about everyone else on this list to get it right, but without at least a comment and a warning in the code that this is the only case in which this code has a chance of working correctly, I worry that it might become example code for other people who let it escape and mutate into an incorrect form. -- c