This is assuming you are passing in a hash ref instead of a hash. This is probably the better way of doing it anyway though, as you aren't passing a bunch of stuff around on each subroutine call.
Polymorphism is generally less stressful if you are passing and polymorphing on references. There really is no uncludgy way to discriminate between a list of two items and a hash, if not passed by reference.