Re: [Module::Build] version.pm and version number comparison problem
Status: Beta
Brought to you by:
kwilliams
|
From: Rob K. <rob...@gm...> - 2006-02-02 19:37:43
|
On 2/2/06, Julian Mehnle <ju...@me...> wrote:
> Chris Dolan wrote:
> > On Feb 2, 2006, at 8:06 AM, John Peacock wrote:
> > > # Unbless it if it's a version.pm object
> > > - $result =3D "$result" if UNIVERSAL::isa( $result, 'version' );
> > > + $result =3D $result->numify if UNIVERSAL::isa( $result, 'version' =
);
> >
> > While we're at it, we should change the
> > UNIVERSAL::isa( $result, 'version' )
> > to
> > eval { $result->isa('version') }
> >
> > See http://search.cpan.org/dist/UNIVERSAL-can/ for the
> > justification. :-)
>
> "This is wrong and you should not do it." -- What kind of justification i=
s
> that??
>
> Why is it wrong to do UNIVERSAL::isa($foo, $type)? This usage is
> documented in `perldoc UNIVERSAL`, and it works fine, after all.
What if I overload can() in order to correctly report what I support
through AUTOLOAD because I will handle dynamic attributes?
UNIVERSAL::can() fails there.
What if I overload isa() in order to report back a facade object is
really what it's decorating? UNIVERSAL::isa() fails there, too.
This isn't as unreasonable as it sounds. I overload isa() in
PDF::Template in order to use node names instead of class names
because the same class might handle multiple node types.
Rob
|