in reply to Re: Determining subroutine return type
in thread Determining subroutine return type

Thanks for the response, and yes I meant "reference to an array" ;)

It seems to me that I left out a particularly important piece of information. All I'm really trying to do is pass through my routine to another caller and verify that I am providing the results that the caller is expecting. As both you and phaylon point out, calling the provided subroutine ref in list context is the solution. The missing piece of the puzzle is how to handle scalars.

friedo provided the answer. If I wind up with a list of length one, I can return a scalar if my wrapper subroutine is called in scalar context as determined by wantarray.

Thanks to all!
  • Comment on Re^2: Determining subroutine return type