sub new { my $class = shift; my $self = {}; $self->{atr1} = undef; $self->{atr2} = undef; # more attributes... bless($self, $class); # ... some code to populate attribs from passed parms return $self; } #### use MyMod; my $mm = MyMod->new(atr1 => 1, atr2 => 'string2');