Re: [perl #46987] OO-call failures, autoviv-functions & testing their existence 
On Oct 29, 2007, at 9:37 p, Linda W wrote:

> A second problem is that the UNIVERSAL "can()" method is broken
> as well.  According to OO-Perl(Conway), "can only returnes true if an
> object or class can call the method requested".  If the local method
> is "undefined" (as is stated in the error message), then "can()"
> cannot return a reference to that function -- since that function  
> method
> is NOT legally callable.

This actually is documented behavior:

can cannot know whether an object will be able to provide a method
through AUTOLOAD, so a return value of undef does not necessarily
mean the object will not be able to handle the method call. To get
around this some module authors use a forward declaration (see perlsub)
for methods they will handle via AUTOLOAD. For such 'dummy' subs, can
will still return a code reference, which, when called, will fall
through to the AUTOLOAD. If no suitable AUTOLOAD is provided, calling
the coderef will cause an error.


from http://search.cpan.org/~nwclark/perl-5.8.8/lib/UNIVERSAL.pm

-Chris


