I have a sub get_vars_hash which returns a a reference to a hash.
#%vars has the structure $vars{$name} = [$local, $value]
return \%vars
Back in main I have the following code
my $vars = get_vars_hash($file);
Dumper(\%$vars); #just for testing.
#outputs
#$var1 = {
# 'DATE'=>[
# 'G234_DATE',
# 'ZERO'
# ],
# 'STOP'=>[
# 'G234_STOP''
# '60'
# ]
# }
#Which is what I expected
foreach $key (keys(%$vars)){
print "$key\n";
}
#outputs
#DATE
#ARRAY(0x1df50b0)
#STOP
#ARRAY(0x1df5074)
Not what I expected. Am I dereferencing the hash incorrectly? One last note the code and sub are called from a button press in a Tk GUI if that has any relevents.
Update:Maybe I've not been clear, I didn't expect to see the array refs at all, in the second bit of code as don't think they are keys in the hash. Maybe I'd better go back to a look at hashes again?