P is for Practical | |
PerlMonks |
Re: method aliases with goto(&NAME)by ikegami (Patriarch) |
on Sep 18, 2013 at 19:24 UTC ( [id://1054727]=note: print w/replies, xml ) | Need Help?? |
What are your motivations? Modify the stack to pretend `legacy_method` wasn't called is surely detrimental. You could avoid that (and speed things up an itsy bit) with the following:
But both the above and your approach fail when a child class overrides current_method. I'd use the following:
(Which actually works and avoids needless copying unlike the code you presented as the baseline.)
In Section
Seekers of Perl Wisdom
|
|