GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  MRO::DEFINE (3)

.ds Aq ’

NAME

MRO::Define - Define your own method resolution order

CONTENTS

SYNOPSIS



    # define your mro
    use mro;
    use MRO::Define;
    MRO::Define::register_mro(your_mro => sub { ... });

    # use your mro somewhere else
    use mro your_mro;



DESCRIPTION

With recent versions of perl it is possible to change the method resolution order (mro) of a given class either by using use mro as shown in the synopsis, or by using the mro::set_mro.

Perl itself comes with two MROs by default. The traditional Perl default MRO (depth first search, DFS) and C3 MRO.

This module allows you to define custom method resolution orders in addition to those perl already has.

FUNCTIONS

register_mro ($name, CW$resolve_callback)

This function allows registering of custom method resolution orders. Your MRO needs to have a $name as well as a $resolve_callback that will get invoked when a method trying to be resolved using your MRO. The resolve callback is expected to return an array reference of package names that will be used for the method lookup.

AUTHOR

Florian Ragwitz <rafl@debian.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by Florian Ragwitz.

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

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 MRO::DEFINE (3) 2013-09-04

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.