in reply to Re: Subroutines and Passing data ...
in thread Subroutines and Passing data ...

I would choose method three as well. When I was starting out doing this I tried returning data in a regular hash (not a hash ref), and that worked, kind of sort of, but then my data got a little more complicated, and I tried putting refs to other hashes in my hash, and this crashed and burned.

So, I would get used to passing data back and forth with hashrefs, or in some circumstances, array refs. I wouldn't return any non-ref array or hash values, just for the sake of... well, that is what my gut says.