use Tracer; package User; sub new { return bless {x => 1, y=> 2}; } sub get_x { my $self = shift; return $self->{x}; } sub set_x { my $self = shift; $self->{x} = shift; return; } package main; my $user = User->new; trace($user); $user->set_x(123); print "X is: ", $user->get_x, "\n";