The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

MRO Functions

These functions are related to the method resolution order of perl classes

Returns the C3 linearization of @ISA the given stash. The return value is a read-only AV*. level should be 0 (it is used internally in this function's recursion).

You are responsible for SvREFCNT_inc() on the return value if you plan to store it anywhere semi-permanently (otherwise it might be deleted out from under you the next time the cache is invalidated).

Returns either mro_get_linear_isa_c3 or mro_get_linear_isa_dfs for the given stash, dependant upon which MRO is in effect for that stash. The return value is a read-only AV*.

You are responsible for SvREFCNT_inc() on the return value if you plan to store it anywhere semi-permanently (otherwise it might be deleted out from under you the next time the cache is invalidated).

Takes the necessary steps (cache invalidations, mostly) when the @ISA of the given package has changed. Invoked by the setisa magic, should not need to invoke directly.

Invalidates method caching on any child classes of the given stash, so that they might notice the changes in this one.

Ideally, all instances of PL_sub_generation++ in perl source outside of mro.c should be replaced by calls to this.

Perl automatically handles most of the common ways a method might be redefined. However, there are a few ways you could change a method in a stash without the cache code noticing, in which case you need to call this method afterwards:

1) Directly manipulating the stash HV entries from XS code.

2) Assigning a reference to a readonly scalar constant into a stash entry in order to create a constant subroutine (like constant.pm does).

This same method is available from pure perl via, mro::method_changed_in(classname).