in reply to CGI and persistent data

If you are not very much worried about memory usage you can clone the data structure and use the cloned data structure. This way you can easily preserve the original data structure. Please take a look at Clone.