My way of implementing
merlyn's suggestion of having
multiple functions with different interfaces is to have
one function that constructed your query string from one
of those interfaces (eg arrays) and then have another that
accepts a hash-ref, repackages that in terms of array
refs, and then calls the first.
So you have exactly one real implementation (should you
want to change the construction of the query string it
is easy to do so) yet you have two functions. One of which
can't be called with a hash ref, the other which needs an
array ref. Without doing any test within the function or
making the implementation of the critical code more complex.