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'); };