package Foo; use strict; use warnings; my $_init_ = sub { my $self = shift; print STDERR ref($self) . "::_init_ called\n"; }; sub new { my $type = shift; my $class = ref($type) || $type; my $self = { attribute1 => undef, attribute2 => undef, }; bless $self,$class; $self->$_init_(); return $self; } 1;