http://www.perlmonks.org?node_id=117661


in reply to Is it better to return a hash of hashes or a reference to a hash of hashes?

Another criterion to use is whether you are returning "final" or "intermittent" data: that is to say, if you just collected results in your subroutine (say, a DBI query), then returning a reference is probably the best idea most of the time. If, however, the data is a persistent part of an object, it is probably unwise to return a reference for several reasons. For one, you are giving your caller full access to the data; for another, some child class may choose to store data differently, so returning a hash reference is no longer a "natural" way to go about the query.