sub new { my $class = shift; my $self = _init(@_); # private method bless($self, $class); return $self; } sub _init { my %data = ( name => 'supreme commander two', rank => 'even better', toothbrush => 'purple with sparklies', ); if (@_) { foreach (keys %{ $_[0] }) { $data{$_} = ${$_[0]}->{$_}; # yuck, probably wrong } } return \%data; # reference! } sub copy { my $self = shift; return $self->new($self); # pass this as a hash ref }