This is fixed in Perl 6, not with generics, but with multiple dispatch. The prejudice of
toward strings is then merely the behavior of the default function that is invoked if a more specific type does not define a more specific behavior. (Of course, generics can help with defining a set of related functions for a new type.) And, of course, you also handle mixed types with multiple dispatch, since that's what it was invented for in the first place.