Yuji Tamashiro > UNIVERSAL-derived_classes-0.02 > UNIVERSAL::derived_classes

Download:
UNIVERSAL-derived_classes-0.02.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.02   Source  

NAME ^

UNIVERSAL::derived_classes - Returns derived classes of a class

SYNOPSIS ^

    require UNIVERSAL::derived_classes;

    package A;

    package B;
    @ISA = qw( A );

    package C;
    @ISA = qw( B );

    package main;
    my @derived_classes          = A->derived_classes;          # B, C
    my @derived_classes_reversed = A->derived_classes_reversed; # C, B

DESCRIPTION ^

UNIVERSAL::derived_classes provides the following methods:

CLASS->derived_classes(REVERSED)
$obj->derived_classes(REVERSED)

Where

REVERSED

is the flag to reverse classes

When used as a class method (CLASS->derived_classes(REVERSED)), derived_classes returns derived classes of the CLASS.

When used as an instance method ($obj->derived_classes(REVERSED)), derived_classes returns derived classes of a class where $obj is blessed.

If the REVERSED flag is true then reversed derived classes are returned.

CLASS->derived_classes_reversed
$obj->derived_classes_reversed

derived_classes_reversed is same as derived_classes(REVERSED)

AUTHOR ^

Yuji Tamashiro, <yuji@tamashiro.org>

COPYRIGHT AND LICENSE ^

Copyright (C) 2007 by Yuji Tamashiro

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: