David Golden wrote:
Steffen Mueller wrote:
John Peacock schrieb:
David Golden wrote:
(Though technically, it really ought to check that the ref equals
"Module::Build::Version").

No, that would be wrong too. Never test a ref() against a specific object class, since it paints you into a corner with inheritance. You really have to
do isa() if you want to test that way...

Since isa() can have a few surprises also, I tend to use _INSTANCE($obj, 'Class') from Adam's small and useful Params::Util module. It's guaranteed to work as advertised. isa() might be overridden if called as a function (bad) or fail if called as a method on a non-object.

But since this is Module::Build, we don't want to go around adding dependencies like that, even if they are useful. (Though cut-and-paste is a possibility.)

Indeed, they are designed to also be relatively easily cut-and-pastable.

Adam K

Reply via email to