If I understand what you are asking, you seem to be wanting to set a variable in one script that outputs some html, and then access that variable's value the next time the form is submitted?
If that's the case you need to be writing a hidden field into your first script's output that has the name and value you want to access in your second script. CGI.pm probably has a method for doing this.
you have to pull the values from the checkbox with a param .. e.g.,
and the resultant array is less tractable to splits and other parsing operations, so be prepared to use a substr() to separate out what you want.