Daniel McBrearty wrote:
 > "Calling UNIVERSAL::Can as a function not a method"

Hi Daniel.

The "bug" is in the CPAN version of UNIVERSAL::can which deliberately "breaks"
the use of UNIVERSAL::can as a function. While we all seem to agree that using
U::can as a function is not recommended *most* of the time, it is entirely
valid and correct Perl code to do so.

Here's my most recent rant on the subject:

http://london.pm.org/pipermail/london.pm/Week-of-Mon-20071119/011479.html

Later in that thread chromatic said he planned to change the module to only
raise a warning rather than an error. I wonder if he's also planning an option
to turn it off altogether?

http://london.pm.org/pipermail/london.pm/Week-of-Mon-20071119/011487.html

So the simple answer is: don't use modules which deliberately break valid Perl
code. I believe the usual suspect is Test::MockObject which uses
UNIVERSAL::can. If you're getting these warnings from a vanilla Catalyst
install then you also need to petition the Catalyst team to not use any
modules that break base Perl. But I'm pretty sure they don't, so I'm guessing
it's something you've added on yourself.

Having said all that, I am (somewhat begrudgingly) planning to code around it
as much as possible for TT3. But I spent a lot of time getting the various
parts of TT2 to work properly with a wide range of different modules that
people might want to plug into it (ISTR that CGI.pm was one that required some
special smarts, for example). That involves the use of UNIVERSAL::can as a
function because it Works Properly[tm], and I'm loathed to change anything in
a minor release that could potentially break TT in certain conditions.

I've got a few other outstanding patches for TT2 waiting in line so I _may_
apply the U::can patch as and when I get around to another TT2 release.  But
I'd rather be spending my time on getting TT3 out the door. :-)

Cheers
A

_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates

Reply via email to