Help for this page

Select Code to Download


  1. or download this
    use 5.10.0;
    package Animal;
    ...
    __END__
    Cow says: moo
    Dog says: wuff
    
  2. or download this
        shift if $_[0] eq __PACKAGE__ || ref $_[0] eq __PACKAGE__;
    
  3. or download this
    use Animal; # contains Cow and Dog as above
    Cow->speak;
    ...
    $animal = bless do{\my $x}, 'Cow';
    Animal::speak($animal);
    $animal->speak;