01: my $_init_ = sub { 02: my $self = shift; 03: print STDERR ref($self) . "::_init_ called\n"; 04: }; 05: 06: sub new { 07: my $type = shift; 08: my $class = ref($type) || $type; 09: my $self = { 10: attribute1 => undef, 11: attribute2 => undef, 12: }; 13: bless $self,$class; 14: $self->$_init_(); 15: return $self; 16: }