for $loopindex (0..4) { $array[$loopindex] = [&zerolist]; } sub zerolist { return (0, 0, 0, 0); } print $array[1][1];