Will this be a browser-based program (CGI)? If so, then after the page is delivered, the program terminates the connection to the dbase is closed, and whatever is in your carefully developed multilevel array will go poof. To "click" again is to invoke the program again, so it will need to be requeried anyway.

and then when the visitor clicks submit again, you can break it back up with something like this

my @array = split( /\t/, $in->param( 'stringifiedarray' ) );

I'll be the first to admit that this method is poor. Requerying is probably be the best (and safest) bet, because someone can fudge with the html source code (by saving the form locally and manually changing the hidden tag data).

If you have data that does not change often, but is frequently called from perl, you can save your hash in a *.pl file and require it into your program. Thus you pay the penalty of creating the hash once, and then get to use it for as long as you want, or until you have to replace it with new data.

To do this you need to use Data::Dumper, write a perl file that contains the hash in a form you can use again, and then require that file into your program when you need it.

Here is a piece of code that will take a hash called %user and you will then be able to use $p_user which is a pointer to the hash. To work with a real hash again you can use the hash %{$p_user}.

The last line of a module or required file should be a true value so I have included the 1 to end the file.

You might have to refer to the pointer as $::p_user but I am too lazy to test it right now. If you are using packages it can get more complicated like $somePackage::p_user depending on where you do the requiring. These loose ends are left as an exercise for the reader.