package Class; sub new { # Or any other name you want. my ($class) = @_; my $self = bless({}, $class); # $self->{...} = ...; return $self; } sub method { my ($self) = @_; #... } my $o = Class->new(); $o->method();