in reply to array of arrays

the syntax is wrong, what you need is
push @{$aod[$id]},$value;
@aod[$id] would be a 1 element array slice.
with @{$aod[$id]} you are saying that the scalar in position $id in your outer array, is to be used as a reference to an array. Since push needs to be passed an array, not a reference, you use the dereferencing syntax @{} to give it what it needs.
The first time you push on a particular element the nested array gets auto-vivified, that is automatically created when needed.


-pete
"Worry is like a rocking chair. It gives you something to do, but it doesn't get you anywhere."