Subject: | Incompatible with any other magic |
Sometimes, other modules most definitely DO need to call UNIVERSAL::can
directly. Modules that are doing black magic, just as UNIVERSAL::can
itself is doing black magic.
Modules that specifically WANT to know whether something can do
something, intentionally ignoring any overloading for various (mostly
nefarious reasons)
As an example, UNIVERSAL::isa needs to do similar black magic, and calls
UNIVERSAL::can directly.
Because it implements the change to a method call by force,
UNIVERSAL::can prevents anybody from ever calling the ACTUAL
UNIVERSAL::can and thus changes behaviour inside other magic modules
(which it's often extremely important that things don't change).
This is likely to (or at the very least creates potential for)
UNIVERSAL::can intersecting with the functionality of other modules that
do similar things to UNIVERSAL::can and having the combination explode
or behavious quite incorrectly.
Short of an attitude change, I really don't know how you can fix this
problem.
I also notice that warnings are now only optional! So instead of always
pestering people and shutting up when warnings are off, we silently
change the behaviour of Perl and don't want by default.
(I'll file that as a seperate bug later)
One solution might be to reverse the way things happen now.
Always warn by default and don't do the magic behavioural change, unless
an import param is provived.
This would mean the absolute least amount of possible potential for
collisions with other magic, while pestering people until the various
bugs are fixed. As you are depending on 5.006 _anyway_ we won't see the
very nasty problems that old 5.005/etc code might create.
This would ALSO mean that in a mass testing environment, we could turn
on -MUNIVERSAL::can and it would in effect act to turn on additional
warnings without any risk that code is going to explode.