sub makeLinks { ... my @nholes = (); for my $nh ($obj->{'board'}->getHoles()) { my %newHole = %$_; push ( @nholes, \%newHole ); } ... } #### sub makeLinks { ... my @nholes = (); for my $nh ($obj->{'board'}->getHoles()) { push ( @nholes, new hole ( $nh->{'peg'}, $nh->{'holeIndex'}, $nh->{'level'}, $nh->{'links'} )); } ... }