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:UNIVERSAL (Score:1)
"FWIW you can already call object_id($obj)."
Oh, of course, because although it is advertised that you're importing it to be called via your package as a method, it can be imported in for use as a function. Hooray!
rjbs
Reply to This
Parent