I have a multi-dimentional data structure, a mix of hashes and arrays. An example would be $$hash{domains}{sub1}{sub2}. If I want to get something out of it I know all I need to do is $hash->{$domain}{$var1}{$var2}. However, I want to pass {$var1}{$var2} to a subroutine so I can:
foreach my $domain (sort {$a cmp $b} keys %{$hash}) { my $value = $hash->{$domain}$test; }
where the variable $test is actually the code {$var1}{$var2}. I've tried my $test = "{var1}{$var2}" but I get an unblessed reference error.
How do I do I get perl to look at $test not as a the string "{$var1}{$var2}" but as the perl code {$var1}{$var2} ? Can I do this at all?
In reply to unblessed reference problem by gdolph
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |