My Perl Quiz

The ultimate place to learn Perl!

Question #46: Which messages will be printed?

package Animal;
sub AUTOLOAD {}                                   
sub new { bless {}, shift }

package Dog;
use base 'Animal';
sub run {}

package main;

my $obj = Dog->new();

if ($obj->can('run')) {
    print "can run\n"  
}
 
if ($obj->can('bark')) {
    print "can bark\n"  
}