in reply to Returning all data from subroutine
Perhaps don't dereference the array refs when returning from subroutines?