the hashref and list branches were exactly the same,
and the arrayref branch only differed slightly.
benchmarks were indistinguishable.
A few minor changes to the wantarray checks and poof! half the function's gone :-)
This is less code to maintain,
but also somewhat a matter of style, though, so it's just my suggestion. TIMTOWTDI
Alter wantarray conditions to eliminate nearly duplicate branch