On Thu, Aug 28, 2014 at 7:43 AM, David Cantrell <da...@cantrell.org.uk> wrote:
> On Wed, Aug 27, 2014 at 08:54:07AM -0700, Karen Etheridge wrote: > > > ..but as others have said, you don't 'use UNIVERSAL' directly - in fact > the > > word 'UNIVERSAL' should never have to appear in your code. > > It might never *have to* appear in your code, but it is on occasion > rather handy. UNIVERSAL::isa is useful for non-objecty code that > manipulates or inspects classes, for example. > True, but we're talking about importing the isa method into the current package. I think that, under most circumstances, explicitly stating "UNIVERSAL::isa($thing, $type)" is more legible than saying "use UNIVERSAL qw(isa);" and later "isa($thing, $type)". If you need to use the function a lot, and if you explicitly want to bypass any overloaded isa methods, you can simply create your own short-name alias with "*isa = \&UNIVERSAL::isa;" And these days, wouldn't it be safer and more robust to just use Safe::Isa? David Mertens -- "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." -- Brian Kernighan