UNIVERSAL-clone reviews

cpanratings
 

RSS | Module Info | Add a review of UNIVERSAL-clone

UNIVERSAL-clone (0.01) *

To pile on, this generally not work for "inside-out" objects in pure Perl, either -- like those created with Class::Std, Class::BuildMethods, etc. *If* Storable is used as the base for this module's action and *if* Object::InsideOut is used with Storable support enable, then it *may* work. (Ditto for Class::Std::Storable.)

UNIVERSAL-clone (0.01) *

I'll chime in as well, but for different reasons: Clone (and Storable) cannot handle all objects, particularly onjects which do some low-level memory allocation in C.

It's not clear for certain types of objects what a clone is: should a clone have the exact internal data structure (an issue for non-deterministic algorithms), should the response times to queries be the same, or should it merely have the same data?

Bad things will happen if you rely on this to actually clone something.

UNIVERSAL-clone (0.01) *

Good grief, make it stop!

UNIVERSAL is not a place to stick things that you think you'd like to use a lot. It really, really isn't. It would have been fine to write a mixin that provides cloning. Hey, you could even give an example showing that you could mix in to UNIVERSAL, if you're completely evil.

Uploading this distribution outside of Acme with a straight face is wrong wrong wrong. I hope the author sees the light and withdraws it.

UNIVERSAL-clone (0.01) *

NO NO NO NO NO!!!

This is one step too far!

UNIVERSAL::isa and UNIVERSAL::can both attempted to "repair" a (certainly) percieved and (arguably) real problem in the way some authors did their "isa" and "can" checks.

While the implementations where ugly, there was _some_ justification for their existance.

Modifying UNIVERSAL is a strategy of LAST resort.

It creates action at a distance which can and does break things and should NEVER be used when any other alternative is available. Witness SVK's problem with PAR because they used the Class::Autouse superloader (which uses UNIVERSAL and recommends against anyone using)

This module modifies UNIVERSAL and creates action at a distance for a mere convenience, and a bad one at that.

It should _never_ be used by any module, and only serves to complicate matters when a simple case by case "use base 'Clone'" or "use Clone 'clone'" would be sufficient.

This module really should not be in CPAN all, as it only serves to encourage people to use it, and encourage even more people to write modules that modify UNIVERSAL proudly, when modifying UNIVERSAL is something that should be done in secret and without mention.

Every modification of UNIVERSAL is a failure to implement what you want in less than evil way.