|the function Class::ISA::super_path($CLASS)||This returns the ordered list of names of classes that Perl would search thru in order to find a method, with no duplicates in the list. $CLASS is not included in the list. UNIVERSAL is not included if you need to consider it, add it to the end.|
|the function Class::ISA::self_and_super_path($CLASS)||Just like super_path, except that $CLASS is included as the first element.|
|the function Class::ISA::self_and_super_versions($CLASS)||
This returns a hash whose keys are $CLASS and its
(super-)superclasses, and whose values are the contents of each
classs $VERSION (or undef, for classes with no $VERSION).
The code for self_and_super_versions is meant to serve as an example for precisely the kind of tasks I anticipate that self_and_super_path and super_path will be used for. You are strongly advised to read the source for self_and_super_versions, and the comments there.
* Class::ISA doesnt export anything. You have to address the functions with a Class::ISA:: on the front.
* Contrary to its name, Class::ISA isnt a class; its just a package. Strange, isnt it?
* Say you have a loop in the ISA tree of the class youre calling one of the Class::ISA functions on: say that Food inherits from Matter, but Matter inherits from Food (for sake of argument). If Perl, while searching for a method, actually discovers this cyclicity, it will throw a fatal error. The functions in Class::ISA effectively ignore this cyclicity; the Class::ISA algorithm is never go down the same path twice, and cyclicities are just a special case of that.
* The Class::ISA functions just look at @ISAs. But theoretically, I suppose, AUTOLOADs could bypass Perls ISA-based search mechanism and do whatever they please. That would be bad behavior, tho; and I try not to think about that.
* If Perl cant find a method anywhere in the ISA tree, it then looks in the magical class UNIVERSAL. This is rarely relevant to the tasks that I expect Class::ISA functions to be put to, but if it matters to you, then instead of this:
@supers = Class::Tree::super_path($class);
@supers = (Class::Tree::super_path($class), UNIVERSAL);
And dont say no-one ever told ya!
* When you call them, the Class::ISA functions look at @ISAs anew that is, there is no memoization, and so if ISAs change during runtime, you get the current ISA trees path, not anything memoized. However, changing ISAs at runtime is probably a sign that youre out of your mind!
Copyright (c) 1999-2009 Sean M. Burke. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Sean M. Burke email@example.com
Maintained by Steffen Mueller firstname.lastname@example.org.
|perl v5.20.3||CLASS::ISA (3)||2009-09-29|