in reply to Retrieving a list of keys from a hash of hashes

To get the list of keys of the hash pointed to by $VAR2, you dereference the hashref:
my @keys = keys %$VAR2;
The same goes for getting the keys of a next level hash: dereference the hashref, which in this case happens to be a hash value as well:
my @keys2 = keys %{$VAR2->{'Model_State'}};
For more information, have a look at perlreftut, perlref and perldsc.

Update: Ugh, this was output from Data::Dumper::Dumper of a hash. BrowserUK broquaint spotted this well. His solution is probably a direct plug in for your program.

CU
Robartes-