in reply to Re: Need help with complex tied data structure
in thread Need help with complex tied data structure

$data[$gid] is a hash ref, so $data[$gid]->{$sample_id} is an element in that hash. To make it more explicit:
foreach $sample_id (@{$groups[$gid]}) { $data[$gid]->{$sample_id} = []; # assign anon array ref to ti +ed hash foreach $element_num ( 0 .. $element_count ) { $element = []; # ... do a bunch of stuff here ... $data[$gid]->{$sample_id}->[$element_num] = $element; } }
Does that make more sense?

Replies are listed 'Best First'.
Re: Re: Re: Need help with complex tied data structure
by perrin (Chancellor) on Nov 20, 2003 at 23:19 UTC
    Is that a typo in your original code then? You never put the tied hash into $data[$gid], you put it in $data[$id] instead.