this construct will not work (like you intended). There is no hash named %origin like in $origin{$pip}. You constructed a hash whose values are references to anonymous hashes (which have no entry in the symbol table and can only be accessed through their reference). Thats fine, you only need to access it through refernces.foreach my $probeset_id (sort keys %{$row{$origin{$pip}}}){
Since you have a hash of hashes (of hashes...) better write it like this
You can retrieve the values like you assigned them. When assigning the values you made use of "autovivification". That is, you relied on Perl to create all hash entries, you referenced. Without "autovivification" your lineforeach my $probeset_id (sort keys %{$row{$origin}{$pip}}){
would have been written like this$row{$origin}{$pip}{$probeset_id}{$affyscore}{$gc} =$probeseq;
$row{$origin} = {}; # set value to an empty hash reference $row{$origin}{$pip} = {}; $row{$origin}{$pip}{$probeset_id} = {}; $row{$origin}{$pip}{$probeset_id}{$affyscore} = {}; $row{$origin}{$pip}{$probeset_id}{$affyscore}{$gc} =$probeseq;
In reply to Re: Complex Data Structure
by hexcoder
in thread Complex Data Structure
by sesemin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |