I appear to have no knack for using hashes. I have a nested hash structure call $ligHash that points to this:
Now I pass each sub hash (i.e. '34k') to a function that dumps it:$VAR1 = { '34k' => { 'R1' => { ... }, 'R2' => { ... } ... }, '34n' => { 'R1' => { ... }, etc... };
I end up getting instead this:foreach my $lig (%{$ligHash}) { DoDump($lig); } sub DoDump { my $ligand = shift; open TEMP, ">>", "ligandDump.txt"; print TEMP Dumper($ligand); close TEMP; }
Does anyone know why this is happening?$VAR1 = '34k'; $VAR1 = { 'R1' => { ... } etc.. } $VAR1 = '34n'; $VAR1 = { 'R1' => { ... } etc.. }
And as a side question, when I dump the entire structure to a .txt file it ends up being ~6.5mb. Is this excessively large to hold in memory or anything like that?
Thanks ahead of time!-Thomas
In reply to Problem cycling through top level of nested hashes by tomdbs98
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |