Method modifiers instead of overrides in object-oriented Perl
Last month [I wrote about using Moose’s
override
function] to, well, override a superclass’s method. Chris Prather on the #moose IRC channel suggested soon after that thearound
method modifier (or its little sistersbefore
andafter
) might be a better choice if you’re also calling the original method inside. He noted that “at a minimumoverride
only works if you’re subclassing,around
will apply to composed methods too.”
Source: Taming the Moose: Method modifiers instead of overrides in object-oriented Perl, an article by Mark Gardner.