7 sub new { bless {} => shift }
17 package CMMChild::Before;
18 use Class::Method::Modifiers;
19 use base 'PlainParent';
21 before method => sub { "B" };
26 extends 'MooseParent';
28 before method => sub { "B" };
32 package CMMChild::Around;
33 use Class::Method::Modifiers;
34 use base 'PlainParent';
36 around method => sub { shift->() . "A" };
41 extends 'MooseParent';
43 around method => sub { shift->() . "A" };
47 package CMMChild::AllThree;
48 use Class::Method::Modifiers;
49 use base 'PlainParent';
51 before method => sub { "B" };
52 around method => sub { shift->() . "A" };
53 after method => sub { "Z" };
56 package MooseAllThree;
58 extends 'MooseParent';
60 before method => sub { "B" };
61 around method => sub { shift->() . "A" };
62 after method => sub { "Z" };
66 use Class::Method::Modifiers;
67 use base 'PlainParent';
70 package Moose::Install;
72 extends 'MooseParent';
75 use Benchmark qw(cmpthese);
76 use Benchmark ':hireswallclock';
80 my $cmm_before = CMMChild::Before->new();
81 my $cmm_around = CMMChild::Around->new();
82 my $cmm_allthree = CMMChild::AllThree->new();
84 my $moose_before = MooseBefore->new();
85 my $moose_around = MooseAround->new();
86 my $moose_allthree = MooseAllThree->new();
90 Moose => sub { $moose_before->method() },
91 ClassMethodModifiers => sub { $cmm_before->method() },
96 Moose => sub { $moose_around->method() },
97 ClassMethodModifiers => sub { $cmm_around->method() },
100 print "\nALL THREE\n";
102 Moose => sub { $moose_allthree->method() },
103 ClassMethodModifiers => sub { $cmm_allthree->method() },
106 print "\nINSTALL AROUND\n";
109 package Moose::Install;
110 Moose::Install::around(method => sub {});
112 ClassMethodModifiers => sub {
113 package CMM::Install;
114 CMM::Install::around(method => sub {});