Subject: | `sub can` make problems |
As documented in perl:
Show quoted text
>can checks if the object or class has a method called METHOD . If it does, then it returns a reference to the sub. If it does not, then it returns undef.
sub can { 1 } breaks every code which does:
if( my $method = $obj->can( 'method_name' ) ) { $method->() }