February 2012
Intermediate to advanced
1184 pages
37h 17m
English
use mro; # enables next::method and friends globally use mro "dfs"; # enable DFS MRO for this class (Perl default) use mro "c3"; # enable C3 MRO for this class
By default, Perl searches for methods with a depth-first search
through the classes (package names) in @INC. The mro
pragma changes that method resolution order. Specifying dfs uses the default depth-first search, while
specifying c3 uses the C3 algorithm to
resolve certain ambiguities in multiple inheritance. Without an import
list, keeps the default method resolution order by enabling features that
interact with C3 method resolution (see Chapter 12).
Read now
Unlock full access