Change the Report modules to use Lmo

This commit is contained in:
Brian Fraser fraserb@gmail.com
2013-02-01 14:06:13 -03:00
parent d816c6497e
commit 809164becd
18 changed files with 476 additions and 238 deletions

View File

@@ -1543,10 +1543,11 @@ sub import {
my $caller = scalar caller(); # Caller's package
my %exports = (
extends => \&extends,
has => \&has,
with => \&with,
confess => \&Carp::confess,
extends => \&extends,
has => \&has,
with => \&with,
override => \&override,
confess => \&Carp::confess,
);
$export_for{$caller} = \%exports;
@@ -1826,6 +1827,16 @@ BEGIN {
}
}
sub override {
my ($methods, $code) = @_;
my $caller = scalar caller;
for my $method ( ref($methods) ? @$methods : $methods ) {
my $full_method = "${caller}::${method}";
*{_glob_for $full_method} = $code;
}
}
}
1;
}