sub insert { my ( $self, $obj_to_insert ) = @_; if ( $self->container_type eq $obj_to_insert->container ) { push(@{$self}, $obj_to_insert); } else { die "I can't hold that object!"; } }