in reply to Writing a hash of two variables to a file
It sounds like what you want is something that does serialization, and an overview of such may be found here: Re: How can I visualize my complex data structure?
HTH,