in reply to Determining subroutine return type

First, I would save it to an @array rather than a scalar. If the element has one value (@ary == 1) it would be a scalar which you can test with ref(). The problem is more to find out whether if it's a hash or an array, because a hash is a list with an even number of elements.

Who design's such functions? Maybe there are ways through the Devel::-Modules, but that's a bit out of my skills yet.

Hope that helped a little,
gr, phay

Ordinary morality is for ordinary people. -- Aleister Crowley