You are viewing the version of this documentation from Perl 5.38.0. View the latest version

CONTENTS

NAME

perlmroapi - Perl method resolution plugin interface

DESCRIPTION

As of Perl 5.10.1 there is a new interface for plugging and using method resolution orders other than the default (linear depth first search). The C3 method resolution order added in 5.10.0 has been re-implemented as a plugin, without changing its Perl-space interface.

Each plugin should register itself by providing the following structure

struct mro_alg {
    AV *(*resolve)(pTHX_ HV *stash, U32 level);
    const char *name;
    U16 length;
    U16 kflags;
    U32 hash;
};

and calling Perl_mro_register:

Perl_mro_register(aTHX_ &my_mro_alg);
resolve

Pointer to the linearisation function, described below.

name

Name of the MRO, either in ISO-8859-1 or UTF-8.

length

Length of the name.