sub RemoveSheep { my $self = shift; my $obj = shift; # This is the sheep object my $field = ${$self->{field}}; my $sheep_ref = $field->Sheep; for my $index (0..$#$sheep_ref) { my $sheep = $sheep_ref->[$index]; if ( $sheep == $obj ) { print "Before Splice: " . @$sheep_ref . "\n"; splice @$sheep_ref, $index, 1; print "After Splice: " . @$sheep_ref . "\n"; last; } } }