13 sub foo { 'Foo::foo(' . (inner() || '') . ')' };
14 sub bar { 'Foo::bar(' . (inner() || '') . ')' }
21 augment 'foo' => sub { 'Bar::foo' };
22 override 'bar' => sub { 'Bar::bar -> ' . super() };
29 override 'foo' => sub { 'Baz::foo -> ' . super() };
30 augment 'bar' => sub { 'Baz::bar' };
40 Let em clarify what is happening here. Baz::foo is calling
41 super(), which calls Bar::foo, which is an augmented sub
42 that calls Foo::foo, then calls inner() which actually
43 then calls Bar::foo. Confusing I know,.. but this is
44 *exactly* what is it supposed to do :)
49 'Baz::foo -> Foo::foo(Bar::foo)',
50 '... got the right value from mixed augment/override foo');
54 Allow me to clarify this one now ...
56 Since Baz::bar is an augment routine, it needs to find the
57 correct inner() to be called by. In this case it is Foo::bar.
58 However, Bar::bar is in-between us, so it should actually be
59 called first. Bar::bar is an overriden sub, and calls super()
60 which in turn then calls our Foo::bar, which calls inner(),
63 Confusing I know, but it is correct :)
68 'Bar::bar -> Foo::bar(Baz::bar)',
69 '... got the right value from mixed augment/override bar');