### In Shoe.pm package Shoe; use strict; use warnings; # Shoes with holes in their soles. my $num_holey = 0; sub new { my $class = shift; my $self = {}; # ... bless $self, $class; return $self; } # Instance method that happens to access a class variable. sub wear_out_sole { my $self = shift; $num_holey++; print "Sole on this shoe has been worn out.\n"; Shoe->how_many_holey(); } # Class methods. sub how_many_holey { my $class = shift; print "Currently, there are $num_holey holey shoes ($class).\n"; } sub incr_num_holey { my $class = shift; $num_holey++; } 1;