I don't know how to answer your actual quesiton, but I think your approach is rather strange. Personally, I'd pass references into the subroutine and have the sub modify their referents.
Just a thought.
The computer can't tell you the emotional story. It can give you the exact mathematical design, but what's missing is the eyebrows.
- Frank Zappa