in reply to "polymorphism" hack: nuts or wise?

Let's break this down just a bit. First you say you want to ensure that a container can only contain certain types of things. In programming-speak, that says "comparison required". So you have two choices: string or integer comparison. Unless performance is critical, string seems fine to me.

Now, as to how you're testing, by using the inheritance tree to call the right function, that doesn't seem too bad to me, either. Normally one would check the other way around - check if $obj_to_insert->isa($self->contained_type()), I think, but either way could work, depending on the design goals.