Help for this page

Select Code to Download


  1. or download this
    package Animal;
    use base qw(Class::Virtual);
    ...
    __PACKAGE__->virtual_methods(qw(get_sound get_color));
    
    1;
    
  2. or download this
    use strict;
    use warnings;
    ...
    warn 'Animal::Duck forgot to implement ' . join ', ', @missing if @mis
    +sing;
    
    print $duck->get_name(), ' says ', $duck->get_sound(), "\n";
    
  3. or download this
    C:\>test.pl
    Atila says "bark bark!"
    Animal::Duck forgot to implement get_sound at C:\test.pl line 12.
    Animal::Duck forgot to implement get_sound() at C:\test.pl line 14