Hopefully the following advice will be sensible regarding the information in hidden fields. If you already have this information on your server, you might consider schemes for keeping it there, and simply matching the two halves back up once you get more information from the client. This prevents tampering and accidents. It also means you only need to parse it once.
As to the data point tracking:
$hash{'nodes'} = {
"test_one" => [ "state_one", "foo", "bar" ],
"test_two" => [ "state_two", "phu", "bah" ]
};
foreach $nodekey ( keys %{$hash{'nodes'}} ) {
$checkstate = $hash{'nodes'}{$nodekey}[0];
print "state of $nodekey = $checkstate\n";
}
(with nods to page 13, The Camel, 3rd Edition).
I'm sure you could also pack an anonymous hash reference instead of those list refs, if you had enough elements that it made sense to be able to call them by name instead of
[x].