John Peacock schrieb:
David Golden wrote:
Dropping the "exists" or changing that to "ref $node->{version}" makes
it all work just fine.

I'll run a few tests in the AM, using both YAML and the fallback M::B::YAML to
make sure there aren't any other surprises...

(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.

Steffen

Reply via email to