info > Class::ISA

Class::ISA(3pm)

📖 NAME

Class::ISA - report the search path for a class's ISA tree

🚀 Quick Reference

Use CaseCommandDescription
Get inheritance path (excluding self) use Class::ISA; my @path = Class::ISA::super_path('Food::Fishstick'); Returns ordered list of superclasses Perl would search for a method, with no duplicates.
Get inheritance path including self my @path = Class::ISA::self_and_super_path('Food::Fishstick'); Same as super_path but includes the class itself as first element.
Get class versions along inheritance tree my %versions = Class::ISA::self_and_super_versions('Food::Fishstick'); Returns hash keyed by class name (including self) with values from each class's $VERSION (or undef).

📋 SYNOPSIS

  # Suppose you go: use Food::Fishstick, and that uses and
  # inherits from other things, which in turn use and inherit
  # from other things.  And suppose, for sake of brevity of
  # example, that their ISA tree is the same as:

  @Food::Fishstick::ISA = qw(Food::Fish  Life::Fungus  Chemicals);
  @Food::Fish::ISA = qw(Food);
  @Food::ISA = qw(Matter);
  @Life::Fungus::ISA = qw(Life);
  @Chemicals::ISA = qw(Matter);
  @Life::ISA = qw(Matter);
  @Matter::ISA = qw();

  use Class::ISA;
  print "Food::Fishstick path is:\n ",
        join(", ", Class::ISA::super_path('Food::Fishstick')),
        "\n";

That prints:

  Food::Fishstick path is:
   Food::Fish, Food, Matter, Life::Fungus, Life, Chemicals

📝 DESCRIPTION

Suppose you have a class (like Food::Fish::Fishstick) that is derived, via its @ISA, from one or more superclasses (as Food::Fish::Fishstick is from Food::Fish, Life::Fungus, and Chemicals), and some of those superclasses may themselves each be derived, via its @ISA, from one or more superclasses (as above).

When, then, you call a method in that class ($fishstick->calories), Perl first searches there for that method, but if it's not there, it goes searching in its superclasses, and so on, in a depth-first (or maybe "height-first" is the word) search. In the above example, it'd first look in Food::Fish, then Food, then Matter, then Life::Fungus, then Life, then Chemicals.

This library, Class::ISA, provides functions that return that list — the list (in order) of names of classes Perl would search to find a method, with no duplicates.

âš™ī¸ FUNCTIONS

âš ī¸ CAUTIONARY NOTES

ÂŠī¸ COPYRIGHT AND LICENSE

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.

👤 AUTHOR

Sean M. Burke <sburke AT cpan.org>

đŸ› ī¸ MAINTAINER

Maintained by Steffen Mueller <smueller AT cpan.org>

Class::ISA
Class::ISA(3pm) 📖 NAME 🚀 Quick Reference 📋 SYNOPSIS 📝 DESCRIPTION âš™ī¸ FUNCTIONS âš ī¸ CAUTIONARY NOTES ÂŠī¸ COPYRIGHT AND LICENSE 👤 AUTHOR đŸ› ī¸ MAINTAINER

Generated by phpman v4.9.26-5-g7740029 Author: Che Dong Under GNU General Public License
2026-08-16 10:15 @2600:1f28:365:80b0:7cb9:fb:26c1:e368
CrawledBy CCBot/2.0 (https://commoncrawl.org/faq/)
Valid XHTML 1.0 Transitional!Valid CSS!