Letter P

perl-NEXT - Provide a pseudo-class NEXT (et al) that allows method redispatch

Website: http://www.perl.org/
License: GPL+ or Artistic
Description:
NEXT.pm adds a pseudoclass named NEXT to any program that uses it.
If a method m calls $self->NEXT::m(), the call to m is redispatched as if the
calling method had not originally been found.
In other words, a call to $self->NEXT::m() resumes the depth-first, left-to-right
search of $self's class hierarchy that resulted in the original call to m.
Note that this is not the same thing as $self->SUPER::m(), which begins a new
dispatch that is restricted to searching the ancestors of the current class.
$self->NEXT::m() can backtrack past the current class -- to look for a suitable
method in other ancestors of $self -- whereas $self->SUPER::m() cannot.
A typical use would be in the destructors of a class hierarchy, as illustrated
in the synopsis above. Each class in the hierarchy has a DESTROY method that
performs some class-specific action and then redispatches the call up the hierarchy.
As a result, when an object of class D is destroyed, the destructors of all its
parent classes are called (in depth-first, left-to-right order).
Another typical use of redispatch would be in AUTOLOAD'ed methods. If such a method
determined that it was not able to handle a particular call, it might choose to
redispatch that call, in the hope that some other AUTOLOAD (above it, or to its left)
might do better.
By default, if a redispatch attempt fails to find another method elsewhere in the
objects class hierarchy, it quietly gives up and does nothing (but see "Enforcing
redispatch"). This gracious acquiescence is also unlike the (generally annoying)
behaviour of SUPER, which throws an exception if it cannot redispatch.

Packages

perl-NEXT-0.65-5m.mo8.noarch [37 KiB] Changelog by Yohsuke Ooi (2016-08-05):
- (20:5.20.0-5m)
- add gcc5 patches

Listing created by Repoview-0.6.6-1m.mo8