package Foo; ## declare inside-out hashes here: my %attr_a; my %attr_b; ## declare private methods here my $private_1 = sub { my $self = shift; # can use $attr_a{$self} here... ... }; my $private_2 = sub { my $self = shift; ... }; ## public methods here sub new { ... } sub public_1 { my $self = shift; # can access attributes here # can call private methods too, with slightly odd syntax: my $result = $self->$private_1(@args); ... } 1;