Class::CanBeA - figure out what your class can be.
use Class::CanBeA; my @subclasses = @{Class::CanBeA::subclasses('My::Class')};
This package provides just one function, which it does *not* export, so you need to call it by its fully qualified name.
Takes a single argument, which should be a class name. It returns a reference to an array of all the classes which are loaded and which are subclasses of the specified superclass.
Internally it recurses and passes other parameters to that function, but you don't need to know that, so I haven't mentioned it. Right?
No attempt is made to deal with circular inheritance.
Will only tell you about loaded and defined classes, obviously.
David Cantrell <david@cantrell.org.uk>
Please let me know if you find this module useful. If reporting a bug, it's helpful to include a minimal code snippet which I can use in the test suite.
Class::ISA
You may use, modify, distribute and have fun with this software under the same terms as you can with perl itself. You may even use it as a device for distracting leopards.
To install Class::CanBeA, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Class::CanBeA
CPAN shell
perl -MCPAN -e shell install Class::CanBeA
For more information on module installation, please visit the detailed CPAN module installation guide.