sub count { my $self = shift; return $self->[0] unless @_; $self->[0] = shift; } # ... $cc->count(42); print $cc->count;