All the Perl that's Practical to Extract and Report

Navigation

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
Without JavaScript enabled, you might want to
use the classic discussion system instead. If you login, you can remember this preference.

Read closer. There is no irony.Polymorphism is already forbidden unless I want to rewrite a significant section of the existing code. I am therefore trying to find a way to get the behavior I want without doing that rewrite or else cutting and pasting.

The first two solutions that I tried (neither of which worked) tried to extend the existing code in such a way that they would not affect anyone else who wanted to extend the existing code using the same technique. In other words I was trying to make my app

There is a significant difference. I'm working on a code-base with a specific purpose that I'm the only developer on. This gives me a fair amount of insight into how it is likely to be modified in the future.The module in question is used by a large number of people for many different things, and therefore the author should assume far less about how it is likely to be used in the future.

I also note that, even though I don't think polymorphism is important within my code base, I looked first for a solution

You're complaining about the UNIVERSAL::isa?That idiom appears within other code within Template::Stash::Context. Again, if you want to fix that, fixing it in my code is less important than changing it in the main module. Doubly so because it already can't be readily subclassed, which makes any worries about the best way to be polymorphic completely irrelevant.

That said, your fix has its own issues. Suppose that somewhere up the calling stack someone is using signals and a die handler. If that signal ha

Therefore if satisfying you interferes with virtually any other desirable code criteria, I will not bother trying to satisfy you. Not because I particularly want to irritate you, but because I care about different things.

Glancing at the title of your journal entry here, one might reasonably assume that you care about things like Liskov substitution. Best of luck to you playing the odds in reliable software development.

(After all, it's not as if signal handling in Perl is at all reliable, whereas nothing in pure Perl requires breaking encapsulation, ever.)