package DeepThought; sub new { bless {}, shift }; sub foo { my $self = shift; $self->bar(42); }; sub bar { my ($self, $n) = @_; print "$self says the answer is $n\n"; };