package Inc; use base 'OO'; sub next { my $self = shift; my $next = $self->oo_get('inc'); $self->oo_set('inc', ++$next); return($next); }; package Inc2; use base qw(Inc); sub current { my $self = shift; $self->oo_get('inc', 'Inc'); }; #### { package Inc; my %Value = (); sub new { bless [], shift; }; sub next { ++$Value{+shift}; }; }; { package Inc2; # ... no way to get at %Value here ... }; #### sub next { my $self = shift; my $next = $self->oo_get('inc'); $self->oo_set('incc', ++$next); return($next); }; #### sub next { ++$Valuee{+shift}; }; #### package AppointmentDate; use base qw(OO Date::Simple); sub appointment { my ($self, $appointment) = @_; $self->oo_set('appointment', $appointment) if $appointment; return( $self->oo_get('appointment') ); };