Using Mason2 . You have 3 components.
/Base.mc
/tmp/Base.mc
/tmp/index.mc
/tmp/index.mc with content:
hello from <% $m->request_path %></br>
<% $.Some %>
$.Someis a method defined in /Base.mc:
<%augment wrap><% inner() %></%augment>
<%method Some>
The default "Some" method defined in the <% __PACKAGE__ %>
</%method>
/tmp/Base.mc contains only
<%augment wrap><% inner() %></%augment>
/tmp/indexFingerprint Request :
hello from /tmp/index
The default "Some" method defined in the MC0::Base_mc
Now the method is added Somein/tmp/Base.mc
<%method Some>
Redefined "Some" method in <% __PACKAGE__ %>
</%method>
Asking /tmp/indexagain, he prints:
hello from /tmp/index
Redefined "Some" method in MC0::tmp_Base_mc
He performed an overridden method Somein wrapped/tmp/Base.mc
The question arises:
If Mason allows overriding methods, as indicated above, what is the purpose <%override method>? Is there something different? (when I tested, it prints the same thing).
EDIT Perhaps the question can be summarized in the following perl code.
use 5.014;
use warnings;
package My;
use Moose;
sub some { say "some from " . __PACKAGE__ }
package My2;
use Moose;
extends 'My';
sub some { say "another some from " . __PACKAGE__ }
package main;
use My2;
my $m = My2->new();
$m->some();
in both cases (for example, "plain" override and override using "override"):
another some from My2
, super() Some override? , - knowlegde...; (