Calling UNIVERSAL::can() as a function is allowed. (was: [OT] best way to determine existence of a function in a package)

Matt S Trout dbix-class at
Wed Nov 21 22:15:09 GMT 2007

On Wed, Nov 21, 2007 at 08:05:42PM +0000, Kake L Pugh wrote:
> On Wed 21 Nov 2007, Andy Wardley <abw at> wrote:
> > I've been personally bitten by the OO dogma when I started getting bug
> > reports about TT not working with one of the popular database ORM packages
> > (Class::DBI?  DBIx::Class?  Can't remember off hand).  It turns out that
> > this package had recently started using the UNIVERSAL::can from CPAN which
> > advertises itself as a "Hack around people calling UNIVERSAL::can() as a
> > function".
> I had to stop using Test::MockObject because of this.  It's a shame,
> because I liked Test::MockObject, but if it won't play nicely with
> Template then I can't use it.

You evidently didn't ask chromatic if he'd take a patch to make it possible
to ask Test::MockObject not to load those (with the current behaviour staying
as the default).

I did. I'm pretty sure he said yes, although it was at a YAPC so I may have
been hallucinating while drunk.

Of course, I never did get around to the patch. Anybody got any spare tuits?

      Matt S Trout       Catalyst and DBIx::Class consulting and support -
   Technical Director
 Shadowcat Systems Ltd.  Christmas fun in collectable card game form -

More information about the mailing list