NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
UNIVERSAL (Score:1)
Perhaps you could add something like
Object::ID->object_id_for($object)
Or use Object::ID qw(obj_id);
These would both avoid UNIVERSAL and avoid needing to add *anything* to *any* class *ever*.
Every time someone puts something in UNIVERSAL, %%RND_BAD_THING%%.
rjbs
Re: (Score:2)
All the objections associated with UNIVERSAL::isa($obj, $class) vs $obj->isa($class); come to mind. Why would you override object_id()? Its too early to say. Apparently we thought the same thing about isa() and can().
OTOH maybe someone might write their own object_id() method that does something different and you'll accidentally get that? Entirely possible, but turns out to be highly improbable. A Google Code Search [google.com] there's only a handful of object_id() methods out there (I cut out BioPerl, Moco and
Re: (Score:1)
You can check in
object_id_forif the object provides a method can trampoline to that. Then you get to have it both ways.Hash::FieldHash (Score:1)
Hi
Why use the heavy-weight Hash::Util::FieldHash when the light-weight Hash::FieldHash is available?
Re:Hash::FieldHash (Score:2)
You're right, it is significantly faster. Over 2x faster. I'll do some more testing and switch it over.
Reply to This
Parent