# initialize an array at once with 3 scalars, two array pointers and one hash pointer: @array= (1,2,3,\@anotherarray,[1,2],{1=>15}); # initialize a hash at once with three keys. Data is one scalar, one hash pointer and one array pointer %hash= (1=>15, 7=>{5=>4}, 2=>[1,2,3]); #### foreach ... { $array[$i][$j]= $value; # or push( @{$array[$i]}, $value); $hash{$i}{$j}= $value; }