use strict; use warnings; package Pendulum; sub new { my ($class, %params) = @_; # Do interesting parameter validation here my $self = bless \%params, $class; # and other set up here. At this point you can call derived class methods # as part of setup if you want using $self->methodName(); return $self; } package main; my $pit = Pendulum->new(Hz => 0.5);