Help for this page

Select Code to Download


  1. or download this
    package Person;
    
    ...
    }
    
    sub name { shift->{NAME} }
    
  2. or download this
    package Male;
    @Male::ISA = qw/Person/;
    ...
    }
    
    sub gender { shift->{GENDER} }
    
  3. or download this
    package main;
    
    my $him = new Male(NAME => "Foo Bar");
    print "\$him is in the class '", ref $him, "'\n";
    print $him->name, " is of the gender ", $him->gender, "\n";
    
  4. or download this
        $him is in the class 'Male'
        Foo Bar is of the gender male