Responses to Comments from ysthMovable Type Pro 4.382019-01-08T01:16:33Zhttps://blogs.perl.org/mt/mt-cp.fcgi?__mode=feed&_type=replies&blog_id=0&id=4755With ->SUPER, your sub is being called first and then it looks up what the superclass is via inheritance. With around, it *creates a new sub* in place and then passes you (at call time) a reference to the previously existing sub, or the method that would have been inherited at the time of 'around'. You're right that later changes to inheritance would not be recognized (changing inheritance at runtime seems like a bad idea in general) but redefining the sub itself would override the 'around' completely since it already installed into that name, so that wouldn't be useful either.tag:blogs.perl.org,2019:/users/kd//2111.9120#18054752019-01-08T01:16:33ZGrinnz
With ->SUPER, your sub is being called first and then it looks up what the superclass is via inheritance. With around, it *creates a new sub* in place and then passes you (at call time) a reference to the previously existing sub, or the method that would have been inherited at the time of 'around'. You're right that later changes to inheritance would not be recognized (changing inheritance at runtime seems like a bad idea in general) but redefining the sub itself would override the 'around' completely since it already installed into that name, so that wouldn't be useful either.]]>