package # hide me from PAUSE
- next;
+ next;
use strict;
use warnings;
+no warnings 'redefine'; # for 00load.t w/ core support
use Scalar::Util 'blessed';
-our $VERSION = '0.06';
+our $VERSION = '0.29';
our %METHOD_CACHE;
my $class = blessed($self) || $self;
my $indirect = caller() =~ /^(?:next|maybe::next)$/;
my $level = $indirect ? 2 : 1;
-
+
my ($method_caller, $label, @label);
while ($method_caller = (caller($level++))[3]) {
@label = (split '::', $method_caller);
my $method;
- my $caller = join '::' => @label;
-
+ my $caller = join '::' => @label;
+
$method = $METHOD_CACHE{"$class|$caller|$label"} ||= do {
-
+
my @MRO = Class::C3::calculateMRO($class);
-
+
my $current;
while ($current = shift @MRO) {
last if $caller eq $current;
}
-
+
no strict 'refs';
my $found;
foreach my $class (@MRO) {
- next if (defined $Class::C3::MRO{$class} &&
- defined $Class::C3::MRO{$class}{methods}{$label});
+ next if (defined $Class::C3::MRO{$class} &&
+ defined $Class::C3::MRO{$class}{methods}{$label});
last if (defined ($found = *{$class . '::' . $label}{CODE}));
}
-
+
$found;
};
sub can { method($_[0]) }
package # hide me from PAUSE
- maybe::next;
+ maybe::next;
use strict;
use warnings;
+no warnings 'redefine'; # for 00load.t w/ core support
-our $VERSION = '0.02';
+our $VERSION = '0.29';
sub method { (next::method($_[0]) || return)->(@_) }
=head1 DESCRIPTION
This module is used internally by L<Class::C3> when
-neccesary, and shouldn't be used (or required in
+necessary, and shouldn't be used (or required in
distribution dependencies) directly. It
defines C<next::method>, C<next::can>, and
C<maybe::next::method> in pure perl.
L<http://www.iinteractive.com>
This library is free software; you can redistribute it and/or modify
-it under the same terms as Perl itself.
+it under the same terms as Perl itself.
=cut